1 Reply Latest reply on Jun 15, 2009 5:45 PM by jeanluc

    SeamTests failing with TestNG parallel tests

    jeanluc

      I've have a simple SeamTest that returns a page containg a table with some data and I've just tried to run it in parallel (eg. @Test (threadPoolSize = 4, invocationCount = 30, timeOut = 30000)). Nothing submitted, a simple hit of the page returns the results, so the test only has a renderResponse() override.


      In each run, many but not all tests fail miserably in various places. Either ConcurrentModificationException inside org.jboss.seam.contexts.ServerConversationContext.getNamesForAllConversationsFromSession() or NPEs in org.jboss.seam.web.IdentityRequestWrapper.<init>(IdentityRequestWrapper.java:23) to name a few.


      The second is concerning: request.getSession() returning null sometimes is not a good sign.


      I'll dig further, but I am curious for now if anyone else has seen similar problems (I'm using Seam 2.1.1GA).


      Thanks,
      -jl

        • 1. Re: SeamTests failing with TestNG parallel tests
          jeanluc

          Interesting, an older thread got pushed up because of a new message and one message contains a relevant comment: You should never have debug true in production, it will lead to instability (ConcurrentModificationException) under load.


          I set it to false but still got several occurrences of





          java.util.ConcurrentModificationException
               at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
               at java.util.HashMap$KeyIterator.next(HashMap.java:828)
               at org.jboss.seam.util.IteratorEnumeration.nextElement(IteratorEnumeration.java:24)
               at org.jboss.seam.servlet.ServletSessionMap.keySet(ServletSessionMap.java:68)
               at org.jboss.seam.contexts.ServerConversationContext.getNamesFromSession(ServerConversationContext.java:205)
               at org.jboss.seam.contexts.ServerConversationContext.clear(ServerConversationContext.java:249)
               at org.jboss.seam.contexts.Contexts.destroyConversationContext(Contexts.java:416)
               at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:258)
               at org.jboss.seam.contexts.ServletLifecycle.endSession(ServletLifecycle.java:146)
               at org.jboss.seam.mock.AbstractSeamTest.end(AbstractSeamTest.java:903)
               at org.jboss.seam.mock.SeamTest.end(SeamTest.java:37)
               at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
               at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
               at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
               at org.testng.internal.Invoker.invokeMethod(Invoker.java:521)
               at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
               at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
               at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
               at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
               at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:132)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
               at java.lang.Thread.run(Thread.java:619)