Coypu/SpecFlow acceptance tests hang when run via Jenkins job

0

I'm running acceptance tests on a project via SpecFlow, NUnit and Coypu (for browser automation, using the WatiN driver). The running of the tests are invoked via a powershell/psake script.

If I run these tests on my local box, they run fine. However, we have a build server on which a Jenkins job will automatically run these tests, and when run via this Jenkins job they don't execute -- they just hang.

Looking in task manager I can see there's two instances of iexplore.exe that are created when the Jenkins job runs. However after a certain point they just hang - no changes in memory usage or CPU.

nunit-agent-x86.exe and nunit-console-x86.exe are also running but mostly hung, just nunit-agent-x86.exe going up very slowly in memory.

If I kill one of the iexplore.exe processes things continue, but the SpecFlow specs all subsequently fail.

At the point of killing iexplore.exe, the following exception is in the log:

Unhandled Exception: System.Runtime.InteropServices.COMException: The remote procedure call failed. (Exception from HRESULT: 0x800706BE)

If I invoke the psake script manually when logged in to the server, the specs run OK.

This issue began to occur when I tried to use basic DI for the BrowserSession as in the gist here: https://gist.github.com/2301407

Before that I was sharing the BrowserSession via a static property of an NUnit [SetupFixture] class. Things were working mostly OK that way, except a small issue with a test involving a modal dialog not working correctly, but I wasn't sure I was doing it right so wanted to do the technique in the gist

I'm a bit lost as to what's causing the hang. Any ideas what it is or tips to track it down?

UPDATE: After switching to Firefox as the browser, and Selenium as the driver, the problem has gone away...

nunit
jenkins
watin
specflow
asked on Stack Overflow Aug 2, 2012 by ngm • edited Aug 3, 2012 by ngm

1 Answer

0

I got a couple of responses on the Coypu list. I've yet to test them out as everything is fine with Firefox at the moment, but in case they are of assistance to anyone else...

On Thursday, 2 August 2012 16:38:30 UTC+1, Adiel wrote:

[...]i believe that watin needs nunit to run in STA (single-threaded) which could possibly be related to your problem.

In other words, perhaps you made your tests thread safe with the static singleton browser session, but now via specflow's IOC you are getting multiple instances due to the way nunit is running.


On Thursday, 2 August 2012 16:41:11 UTC+1, Matt Ellis wrote:

This sounds like it's Internet Explorer's protected mode getting in the way. IE runs different zones, such as Internet and Intranet (and about:blank) in different processes, and IIRC WatiN doesn't handle that very well. If you can disable protected mode on your server, you should be fine.

answered on Stack Overflow Aug 3, 2012 by ngm

User contributions licensed under CC BY-SA 3.0