Open worldjoe opened 10 years ago
Here's my full log (with stack trace output added):
[INFO] --- saga-maven-plugin:1.5.3:coverage (default) @ healthcare ---
11:28:40.607 [main] INFO com.github.timurstrekalov.saga.core.cfg.InstanceFieldPerPropertyConfig - Setting FIREFOX17 as browser version
11:28:40.621 [main] INFO com.github.timurstrekalov.saga.core.cfg.InstanceFieldPerPropertyConfig - Setting HTML, RAW, COBERTURA as report formats
11:28:40.634 [main] INFO com.github.timurstrekalov.saga.core.DefaultCoverageGenerator - 1 tests found
11:28:40.634 [main] INFO com.github.timurstrekalov.saga.core.DefaultCoverageGenerator - Using up to 1 threads
11:28:40.635 [main] INFO com.github.timurstrekalov.saga.core.DefaultCoverageGenerator - Output strategy set to TOTAL
11:28:40.635 [main] INFO com.github.timurstrekalov.saga.core.DefaultCoverageGenerator - Using the following no-instrument patterns:
.+/dependencies/.+.js
.+/platform.twitter.com/..+.js
.+/stats.g.doubleclick.net/.+.js
.+_from\d+_\d+to\d+\d+$
.+/www.google-analytics.com/.+.js
.+#\d+(eval)(\d+)
.+JavaScriptStringJob
.+/connect.facebook.net/..+.js
injected script
11:28:40.657 [pool-1-thread-1] INFO com.github.timurstrekalov.saga.core.TestRunCoverageStatisticsCallable - Running test at http://172.28.165.131:49263
11:28:40.740 [pool-1-thread-1] INFO org.eclipse.jetty.server.Server - jetty-8.1.14.v20131031
11:28:40.770 [pool-1-thread-1] INFO org.eclipse.jetty.server.AbstractConnector - Started SelectChannelConnector@0.0.0.0:49550
11:28:40.770 [pool-1-thread-1] INFO com.github.timurstrekalov.saga.core.server.InstrumentingProxyServer - Proxy server started on port 49550
Apr 15, 2014 11:28:40 AM org.openqa.selenium.phantomjs.PhantomJSDriverService
I have to wonder if some of my code is the culprit making the list change size. In particular I have code like this: (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=98918901269"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); }
//Twitter
window.twttr = (function (d,s,id) {
var t, tjs, tfjs = d.getElementsByTagName(s)[0];
tjs=d.createElement(s); tjs.id=id;
tjs.src="//platform.twitter.com/widgets.js";
tfjs.parentNode.insertBefore(tjs, tfjs);
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f); } });
}(document, "script", "twitter-wjs"));
Note that it injects a script into the dom. My coverage reports seem to be printed out correctly more often if I comment out all that code.
I get blank coverage reports quite often. I took a look at the warning above and dug around a bit. The exception message isn't helpful since it's null. So I modified the source to output a stack trace as well:
[java.util.LinkedList$ListItr.next(LinkedList.java:891) com.github.timurstrekalov.saga.core.TestRunCoverageStatisticsCallable.collectAndWriteRunStats(TestRunCoverageStatisticsCallable.java:90) com.github.timurstrekalov.saga.core.TestRunCoverageStatisticsCallable.runTest(TestRunCoverageStatisticsCallable.java:79) com.github.timurstrekalov.saga.core.TestRunCoverageStatisticsCallable.call(TestRunCoverageStatisticsCallable.java:39) com.github.timurstrekalov.saga.core.TestRunCoverageStatisticsCallable.call(TestRunCoverageStatisticsCallable.java:18) java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) java.util.concurrent.FutureTask.run(FutureTask.java:166) java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) java.util.concurrent.FutureTask.run(FutureTask.java:166) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:724)]
The trace tells me that TestRunCoverageStatisticsCallable.collectAndWriteRunStats is failing on line 90. In particular getLocalBrowser().getScriptDataList() is returning a List that is changing/modifiying the underlying list in another thread (or perhaps in the for loop itself).
I haven't been able to debug why it's changing yet. But I put a placeholder fix to solve the problem on my local machine for now. try { Thread.sleep(8000); } catch (Exception e) {} for (final ScriptData data : getLocalBrowser().getScriptDataList()) {
I just added a sleep before that iterator. So far that seems to work. Which would imply someone else is modifying the list, and not the for loop itself. No way for me to know for sure without more time to debug.