1
Vote

System.Net.HttpListenerException with build 1.6.4635

description

With the official binaries (1.6) my test are working perfectly.I want to try to setup Statlight with TFS 2012 so I upgraded the binaries to the lastest version (v1.6.4635 build of "09 Sep 12 14:50") but now I am getting an exception on every XAP.The translated error is :System.Net.HttpListenerException (0x80004005): The operation of input / output has been abandoned due to the termination of a thread exit or an application request … System.Net.HttpListener.GetContext() … StatLight.Core.WebServer.InMemoryWebServer.ServeRequests() Note : I have a reference on a dll named XUnitContrib.Runner.Silverlight.dll but it's nothing related to the project XUnitContrib. It's just a custom provider I named like this to be sure statlight will treat it as a custom provider.The Log are attached

file attachments

comments

staxmanade wrote Nov 14, 2012 at 3:26 PM

The log seems to report the first XAP as correctly running. Could you try running one xap at a time and see if that helps?

nazbrok wrote Nov 14, 2012 at 5:19 PM

StatLight\StatLight.exe -x="ProjectA.Test.Web\ClientBin\Project1.Module1.Test.SL.xap" --debug

the problem is still there :

StatLightService.TestComplete() with 14 total messages posted - Currently have 14 registered
SignalTestCompleteClientEvent
{
TotalMessagesPostedCount: 14
                  Failed: False
       TotalFailureCount: 0
         TotalTestsCount: 3
               OtherInfo: 
       BrowserInstanceId: 0
  ClientEventCreatedTime: 14/11/2012 19:17:11
}

Awaiting a total of 14 messages - currently have 14
publishing TestRunCompletedServerEvent
webBrowser.Stop()
System.Net.HttpListenerException (0x80004005): L'op‚ration d'entr‚e/sortie a ‚t‚ abandonn‚e en raison de l'arrˆt d'un thread ou … la demande d'une application
… System.Net.HttpListener.GetContext()
… StatLight.Core.WebServer.InMemoryWebServer.ServeRequests()

System.Net.HttpListenerException (0x80004005): L'op‚ration d'entr‚e/sortie a ‚t‚ abandonn‚e en raison de l'arrˆt d'un thread ou … la demande d'une application
… System.Net.HttpListener.GetContext()
… StatLight.Core.WebServer.InMemoryWebServer.ServeRequests()

*************** Summary ********************

Total : 3
Successful : 3
Failed : 0
Ignored : 0
Completion End : 14/11/2012 19:17:11
Duration : 00:00:09.0894684

nazbrok wrote Nov 14, 2012 at 6:22 PM

I don't know what's going on but now I also get this error on the version 1.6.4375

staxmanade wrote Nov 19, 2012 at 5:41 PM

Apologies for not responding sooner, but I'm afraid I'm unsure what the issue is/how to repro it...

Are you only getting this on one server (the build server?). Or are you also getting this elsewhere?

nazbrok wrote Nov 22, 2012 at 6:08 PM

My TFS build server isn't yet configured for the test so I am testing on my computer.

Looking more closely to the log I think I know what's going on. Statlight start his own server on port 8887 but I am using my own server (cassini) on a different port because I need to initialise stuff on the server to have the client working.
The timeout is on statlight's server, so maybe it has no impact at all on me ?! Right now my tests passed despite this error.


testPageUrlWithQueryString = http://localhost:8887/GetHtmlTestPage? IRunner typeof(OnetimeRunner) Starting Test Run: 22/11/2012 19:53:33 Listening on http://localhost:8887/ System.Net.HttpListenerException (0x80004005): L'op‚ration d'entr‚e/sortie a ‚t‚ abandonn‚e en raison de l'arrˆt d'un thread ou … la demande d'une application
… System.Net.HttpListener.GetContext()
… StatLight.Core.WebServer.InMemoryWebServer.ServeRequests()


*************** Summary ********************

Total : 9
Successful : 9
Failed : 0
Ignored : 0
Completion End : 22/11/2012 19:53:38
Duration : 00:00:57.9368569

wrote Feb 14, 2013 at 8:17 PM

faxedhead wrote Jun 13, 2013 at 4:42 AM

I was having this issue and it was causing failed tests due to triggering the test to be completed twice, (1st time passes, second time fails due to the above exception. I fixed it by changing InMemoryWebServer.LogException() method to ignore HttpListenerException:
        // This exception would be cool to get rid of - but I'm not sure how to shut down the process more gracefully
        if (!msg.Contains("The I/O operation has been aborted because of either a thread exit or") && !(exception is HttpListenerException))
AND
in changing InMemoryWebServer.Stop() to:
    public void Stop()
    {
        try
        {
            Listening = false;
            Server.Close();
        }
        catch { }

        Server = null;
    }
Don't know what the root cause is, but this at least makes my tests run reliably now.