1

Closed

"No communcation from the web browser" error when running large xUnit test suite

description

We have a large test suite that, in total, takes more than five minutes to run (though no individual tests more than a few seconds). After five minutes, and seeing steady updates on the console, StatLight fails with the error: "No communication from the web browser has been detected. We've waited longer than the configured time of 00:05:00"
 
Here is a test that can reproduce the issue:
 
[Theory]
[PropertyData("LotsOfData")]
public void this_theory_will_take_more_than_five_minutes_for_all_tests(int data)
{
// Used to guarantee that the total run of 100 tests will take at least 5*60=300 seconds.
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(5));
}
 
public static IEnumerable<object[]> LotsOfData
{
get { return Enumerable.Range(0, 100).Select(data => new object[] { data }); }
}
 
This shows steady progress, displaying around sixty progress dots in the console, before the error occurs. I can also reproduce the issue with a hundred "[Fact] public void FakeTest00() { System.Threading.Thread.Sleep(TimeSpan.FromSeconds(5)); }, [Fact] public void FakeTest01..., etc" tests, but the theory is easier :)
 
(See also http://statlight.codeplex.com/workitem/13108 where issue was first mentioned.)
Closed Mar 7, 2011 at 7:50 PM by staxmanade

comments

staxmanade wrote Mar 3, 2011 at 1:16 AM

Looks like I didn't add the BrowserCommunicationTimeoutMonitor to the EventSubscriptionManager so its internal timer was never re-set when the events coming from the client were pushed through the system. (oops)

Thanks for the excellent bug report.

wrote Mar 3, 2011 at 1:36 AM

EmperorXLII wrote Mar 3, 2011 at 2:35 PM

Almost! Getting a build error now when I try to compile with your change:

StatLight\src\StatLight.Core\Runners\StatLightRunnerFactory.cs(184): error : CA2000 : Microsoft.Reliability : In method 'StatLightRunnerFactory.StartupBrowserCommunicationTimeoutMonitor()', call System.IDisposable.Dispose on object 'new TimerWrapper(3000)' before all references to it are out of scope.

And thanks for all your help!

staxmanade wrote Mar 3, 2011 at 2:36 PM

EmperorXLII wrote Mar 3, 2011 at 2:36 PM

wrote Mar 3, 2011 at 2:36 PM

staxmanade wrote Mar 3, 2011 at 10:41 PM

Doh - That's what I get for not having a true C.I. on the build of a tool built to support C.I. :)

staxmanade wrote Mar 4, 2011 at 2:17 PM

FYI: I've merged a series of changes I made in a branch into the master branch. Part of those changes included the release build compilation fix you were experiencing an issue with. Please take a shot at it and let me know if you have any other issues. Thanks

EmperorXLII wrote Mar 7, 2011 at 3:28 PM

Got the latest and everything appears to be working correctly :) Thanks again!

wrote Mar 7, 2011 at 7:50 PM

wrote Feb 14, 2013 at 8:18 PM

wrote May 16, 2013 at 9:50 AM