Sorry for talking to myself but... waitForBackgroundJavaScriptStartingBefore looks like a possible cause. It is called here: http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java#158 with a value of 2s the implementation of this method seems a bit odd: http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.htmlunit/htmlunit/2.9/com/gargoylesoftware/htmlunit/WebClient.java#WebClient.waitForBackgroundJavaScriptStartingBefore%28long%29 It seems to block while the number of jobs is different to the number of jobs after the time passed to it...
This time starts _before_ servlet startup so in our case that could easily be longer than 2s.... Just me or both these bits of code a bit dodgy? Maybe gwt should pass the unit test timeout value to htmlunit or just some huge value? Thanks Sam On Friday, July 6, 2012 10:23:02 AM UTC+1, salk31 wrote: > > Has anybody else had cases where Scheduler and DeferredCommands have > stopped being scheduled/run when used in unit tests? > > We have a lot of async code so need to use them a lot but currently, > seemingly at random, our tests stall until they get timed out. Even setting > up a periodic job that is never meant to stop will fail at the same > time/point as our normal jobs. > > Lot of code going on with > junit/GWTTestCase/htmlunit/jetty/requestfactory/database... and because it > is hard to reproduce it is proving tough to fix. > > Many thanks > > Sam > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/34VpCnP3M4EJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
