This project is read-only.
2

Closed

Tests are hanging (ChutzpahTimeoutException)

description

Hello!

I am having this strange error I cant find solution online. I've installed Chutzpah and ran it a couple of times in my computer, then I restarted and I get this sort of error when trying to run from extension or command line:
chutzpah.console /wait /path C:\Projects\CP\Testing\RESAAS.JavaScriptTestSuite\Specs
....
Chutzpah Error: Chutzpah.Exceptions.ChutzpahTimeoutException: Timeout occured when running C:\Projects\CP\Testing\RESAAS.JavaScriptTestSuite\Specs\User\RegistrationSpec.js
at Chutzpah.TestRunner.HandleTestProcessExitCode(Int32 exitCode, String inputTestFile) in c:\Dev\chutzpah\Chutzpah\TestRunner.cs:line 217
at Chutzpah.TestRunner.InvokeTestRunner(String headlessBrowserPath, TestOptions options, TestContext testContext, TestRunnerMode testRunnerMode, ITestMethodRunnerCallback callback) in c:\Dev\chutzpah\Chutzpah\TestRunner.cs:line 200
at Chutzpah.TestRunner.<>c__DisplayClass2.<ProcessTestPaths>b__1(PathInfo testFile) in c:\Dev\chutzpah\Chutzpah\TestRunner.cs:line 143
While Running:C:\Projects\CP\Testing\RESAAS.JavaScriptTestSuite\Specs\User\RegistrationSpec.js
Chutzpah Error: Chutzpah.Exceptions.ChutzpahTimeoutException: Timeout occured when running C:\Projects\CP\Testing\RESAAS.JavaScriptTestSuite\Specs\User\SendMessageSpec.js
at Chutzpah.TestRunner.HandleTestProcessExitCode(Int32 exitCode, String inputTestFile) in c:\Dev\chutzpah\Chutzpah\TestRunner.cs:line 217
at Chutzpah.TestRunner.InvokeTestRunner(String headlessBrowserPath, TestOptions options, TestContext testContext, TestRunnerMode testRunnerMode, ITestMethodRunnerCallback callback) in c:\Dev\chutzpah\Chutzpah\TestRunner.cs:line 200
at Chutzpah.TestRunner.<>c__DisplayClass2.<ProcessTestPaths>b__1(PathInfo testFile) in c:\Dev\chutzpah\Chutzpah\TestRunner.cs:line 143
While Running:C:\Projects\CP\Testing\RESAAS.JavaScriptTestSuite\Specs\User\SendMessageSpec.js

=== 0 total, 0 failed, took 0.00 seconds ===

Any insights would be greatly appreciated

file attachments

Closed Feb 23, 2013 at 11:39 PM by mmanela
Fixed in 2.3

comments

mmanela wrote Oct 30, 2012 at 8:47 PM

Could you attach a simple solution to the issue that repros the timeout exception you are getting? I can then use this to debug locally.

Thanks!

fabianoResaas wrote Oct 30, 2012 at 11:11 PM

Hi, thanks for the attention! I don't have a solution for it, my problem is troubleshooting why it happened, such as:
  • Installed the v 2.1 successfully
  • Ran individual tests, ran the whole folder, success
  • Restarted the computer and tried again and now I only get that message (except when running individual tests on browser, which works just fine)
Also opened a question in S.O. with similar details: http://stackoverflow.com/questions/13146124/tests-are-hanging-chutzpahtimeoutexception

mmanela wrote Oct 30, 2012 at 11:39 PM

Sorry, I mean can you attach a zip file with the files needed to reproduce your issue.

BrockAllen wrote Dec 16, 2012 at 9:40 PM

I have the same issue. Newly installed Chutzpah, new project, first time trying it. Works when I use the browser. Console fails every time.

BrockAllen wrote Dec 16, 2012 at 9:57 PM

So I narrowed this down - when I right-click the .js file to run it hangs. When I right-click the .html file to run then it works fine.

BrockAllen wrote Dec 16, 2012 at 10:11 PM

Ok, found the issue -- turns out your the addon chokes on this line in the .js:

/// <reference path="http://code.jquery.com/qunit/qunit-1.10.0.js" />

Same thing if I make it relative:

/// <reference path="qunit-1.10.0.js" />

But works when I remove it.

I also have the VS2012 Chutzpah test explorer addon. The line above is also affecting the test explorer -- it starts to choke and hang and not update properly.

mmanela wrote Dec 17, 2012 at 1:40 AM

Thanks for narrowing the issue down for me. I will investigate this and report back if I found a fix.

mmanela wrote Dec 17, 2012 at 4:29 AM

Ok I can repro what you describe. The issue is caused by Chutzpah loading two instanced of QUnit on the same page. This interferes (although I haven't pinpointed where) with how Chutzpah hooks into the test framework to read the results. Chutzpah will always try to load its version of QUnit even if you specify your own. We have a couple options here
  1. Make chutzpah not copy its version of QUnit if you specify your own
  2. Make chutzpah work when two version are specified.

BrockAllen wrote Dec 17, 2012 at 3:25 PM

Thanks for looking into it - I guess I'm confused why it does this when the line of code that triggers the issue is a comment. I found that if I use this syntax, it then works:

/// <reference path="foo.js" >

As opposed to the "official" VS reference syntax:

/// <reference path="foo.js" />

So the 2nd one fails. The 1st one (with the incorrect yet still functioning intellisense syntax) works.

In any event, I suspect people will want to use the /// <reference> syntax in their JS files to get intellisense, so this should get addressed in Chutzpah, IMO.

mmanela wrote Dec 18, 2012 at 1:43 AM

This issue should be fixed in my last checkin (http://chutzpah.codeplex.com/SourceControl/changeset/c58f887efc51).

Ill include in the next release.

BrockAllen wrote Dec 18, 2012 at 2:46 AM

Many thanks.