-
Bug
-
Resolution: Done
-
Minor
-
3.1.5.Final
-
None
-
None
There is a race condition in AbstractDispatchingTestCase which is causing the DispatchingTest to fail intermittently in QE lab.
Looking e.g. into testCrossContextForward() test
@Test public void testCrossContextForward(@ArquillianResource(MainServlet.class) URL contextPath) throws IOException { assertEquals("second:second", getResponseAsString("main/dispatch/forward?crossContext=true")); assertEquals("true", getResponseAsString("main/validate")); }
The first request on main servlet causes FirstBean lifecycle to increase TestBean constructions and destructions count. The second request should validate that constructions and destructions counts are equals. It could happen that validate request is run before @PreDestroy manage to finish, thus validation fails with expected:<[true]> but was:<[constructions: 3, destructions: 1]> like message.
Link for failed runs https://master-jenkins-csb-eap-qe.cloud.paas.psi.redhat.com/job/eap-7.x-weld-tests-incontainer-rhel/589/
I manage to reproduce locally by running some heavy load on my laptop to slow down the WildFly server (not really a good reproducer). One way to reproduce this (artificially) is to add some sleep (a few millis will do the job) into TestBean#destroyed() and help the race condition to occur.