On Saturday, October 7, 2017 at 5:20:15 PM UTC+2, Thomas Broyer wrote: > > > > On Saturday, October 7, 2017 at 4:54:28 PM UTC+2, Colin Alworth wrote: >> >> Like we do for >> com.google.gwt.junit.RunStyleHtmlUnit.HostedJavaScriptEngine so we can hook >> in the "plugin". Looks like that idea might be a winner! Just make sure to >> swap it in both cases, don't want to kill tests in old dev mode. >> > > Seems to be working. I still have 2 tests failing in JUnitSuite > (GWTTestCaseSetupTearDownTest#testSetUpTearDownTimeout and > GWTTestCaseAsyncTest#testLateFinsh_assert), both of them expecting > TimeoutException and getting a SerializableThrowable instead. Need to debug > this using -Dgwt.htmlunit.debug now (exception thrown from Impl.java:215, > i.e. Impl#reportToBrowser, the object is logged as "[object Object]" so I > need a debugger to understand what happens) >
OK, so, there's a problem of isolation: the exception from testSetUpTearDownFailAsync is making testSetUpTearDownTimeout fail. This is likely because GWTTestCase's reportUncaughtException (called from the Impl.uncaughtExceptionHandlerForTest) immediately reportResultsAndRunNextMethod, which schedules the next test with Scheduler.get().scheduleDeferred. Then (from Impl's reportUncaughtException), reportToBrowser is called which throws the exception again in a setTimeout(…, 0). scheduleDeferred uses setTimeout(…, 1), but because HtmlUnit clamps the delay at 1ms anyway, the scheduleDeferred command is run before the exception is thrown to the browser. Removing the setTimeout from Impl's reportToBrowser fixes the test, but (probably) only because reportUncaughtException is called by the top-most $entry(); otherwise it'd (probably) be caught by the parent $entry and re-routed to the UncaughtExceptionHandler. Daniel, is there any other change you have internally that's not sync'd to open source? I don't quite understand how that could work even with the earlier HtmlUnit. -- You received this message because you are subscribed to the Google Groups "GWT Contributors" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/49111dbf-d8cc-47cc-983c-c9d13fe8301d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.