You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "ljmcr (via GitHub)" <gi...@apache.org> on 2024/09/04 01:21:19 UTC
[PR] fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized [openwebbeans]
ljmcr opened a new pull request, #100:
URL: https://github.com/apache/openwebbeans/pull/100
…Beans
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openwebbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized [openwebbeans]
Posted by "ljmcr (via GitHub)" <gi...@apache.org>.
ljmcr commented on PR #100:
URL: https://github.com/apache/openwebbeans/pull/100#issuecomment-2417931331
> This code part is not intended to be used in parallel. When running the Tests in parallel, they should boot up different BeanManagers. That can be done with running those in own isolated ClassLoaders. I also tried it locally with even more nondex runs and got no problems.
Hi, Thank you for the response.
The test failure occurs when running with different seed values using Nondex, not when running a single Nondex run multiple times. Could you try reproducing the error using the following command?
`Dtest=org.apache.webbeans.test.specalization.observer.pub.PublicObserverTest#testObserverMethodsInParentOfAlternativeAndSpecializedBeans -DnondexRuns=10`
which -DnondexRuns=10 flag represent running with different seed values. For more information of Nondex may check [NonDex](https://github.com/TestingResearchIllinois/NonDex) by running:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openwebbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized [openwebbeans]
Posted by "tandraschko (via GitHub)" <gi...@apache.org>.
tandraschko closed pull request #100: fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized
URL: https://github.com/apache/openwebbeans/pull/100
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openwebbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized [openwebbeans]
Posted by "struberg (via GitHub)" <gi...@apache.org>.
struberg commented on PR #100:
URL: https://github.com/apache/openwebbeans/pull/100#issuecomment-2418550899
> Hi, Thank you for the response. The test failure occurs when running with different seed values using Nondex, not when running a single Nondex run multiple times.
Hi!
Seems nondex is a really cool tool for testing whether tests are really reliable. In this very case it creates a false positive though. The reason is that the whole CDI container is not intended to be started in parallel for the same application. Or rather for the same ClassLoader. This is the very core of a JavaEE/JakartaEE container and thus most parts are single threaded by definition. Probably there is some room for internal parallelisation but I fear removing from a list based on a single boolean is not helping much.
The point is that OWB (as Spring and tons of other containers) does rely on basically a Map<ClassLoader, BeanManageImpl>. You CAN support running parallel tests, but then you have to do tricks like adding an intermediate ClassLoader (new URLClassLoader) like we did in a few specific tests and set this as TCCL for the thread.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openwebbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized [openwebbeans]
Posted by "ljmcr (via GitHub)" <gi...@apache.org>.
ljmcr closed pull request #100: fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized
URL: https://github.com/apache/openwebbeans/pull/100
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openwebbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix flaky test testObserverMethodsInParentOfAlternativeAndSpecialized [openwebbeans]
Posted by "ljmcr (via GitHub)" <gi...@apache.org>.
ljmcr commented on PR #100:
URL: https://github.com/apache/openwebbeans/pull/100#issuecomment-2433808093
Hi, Thank you for the reply,
Please ignore the previous mention of "parallel", which is not a correct analysis in this case. The issue is come from modifying the collection during iteration caused an ArrayIndexOutOfBoundsException, as the internal state of the IdentityHashMap (or other underlying data structures) became inconsistent when the iteration order changed unexpectedly. This error occurred because the original code implicitly relied on the collection being in a particular state while modifying it during iteration, an assumption that NonDex exposed as a bug. The original removeIf() method modified the collection during iteration, which is inherently risky when the collection's internal state may change (especially under NonDex). I have also tried to use the Iterator() for map as an alternate solution, but the errors still occurred when running with different seeds for multiple times. Using a hashset to collect all the elements to be removed is a better solution from my point of view, which ignore the
dependency on iteration order and avoids modifying the map during iteration, also ensures that the code can handle randomized iteration order without throwing exceptions or causing inconsistent internal states.
I am willing to discuss any other solutions and appreciate for any further feedbacks, thank you!
> > Hi, Thank you for the response. The test failure occurs when running with different seed values using Nondex, not when running a single Nondex run multiple times.
>
> Hi!
>
> Seems nondex is a really cool tool for testing whether tests are really reliable. In this very case it creates a false positive though. The reason is that the whole CDI container is not intended to be started in parallel for the same application. Or rather for the same ClassLoader. This is the very core of a JavaEE/JakartaEE container and thus most parts are single threaded by definition. Probably there is some room for internal parallelisation but I fear removing from a list based on a single boolean is not helping much. The point is that OWB (as Spring and tons of other containers) does rely on basically a Map<ClassLoader, BeanManageImpl>. You CAN support running parallel tests, but then you have to do tricks like adding an intermediate ClassLoader (new URLClassLoader) like we did in a few specific tests and set this as TCCL for the thread.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openwebbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org