Closed DmitriyKapeliukh closed 1 year ago
Looking at your stack trace, the main thread is not waiting for the JUnitCore
constructor. It's blocked in some code in com.googlecode.junittoolbox.ParallelScheduler
. I suggest reaching out to the maintainers of https://github.com/MichaelTamm/junit-toolbox for help.
I would be remiss to point out that what you are doing is highly nonstandard, and possibly problematic. By the time an @AfterClass
static method is called, any failures have already been reported to the test listeners (unless you have a custom test runner that does the retries). In fact, the entire rerun is invisible to the installed test listeners and to any scheduler being used, which may be why things are failing.
I've seen some people do retries in a custom Rule (which can also be problematic, as any state on the test class that is created at construction time and not reset in a @Before
or @After
method may not have the correct value).
Hi folks!
I have a test automation framework based on Junit v4.13 with a custom test rerun option. Based on my business specific I'm triggering a rerun test from @AfterClass annotation when the first run fas failed. The annotated method has a lot of specific calls and the major is rerun @Test, code is below:
The problem is the rerun phase is stuck from time to time and the is no reason for that. So Juint could not run the failed test and the whole regression is stuck up to Jenkins pipeline timeout (4h). I've got a thread dump where the main thread waits for new JUnitCore() constructor. surefire.txt
Attached thread dump