Chutzpah Test Adapter – Timeout occurred when executing test file

We have a mix of C# and JavaScript unit tests in our main solution which use the nUnit and Chutzpah Visual Studio Test Adapters, respectively.  I recently noticed the number of tests listed in the Test Explorer dropped significantly which raised concerns.  In researching further I found the following error message in the Tests Output window:

image

NUnit Adapter 3.9.0.0: Test execution complete
========== Run test finished: 1568 run (0:00:49.0727445) ==========
—— Discover test started ——

Error: Timeout occurred when executing test file

While Running:d:\some.qunit.tests.js

========== Discover test finished: 0 found (0:00:11.9518741) ========

The Solution

We have several JavaScript test files but some.qunit.tests.js is the largest with several hundred test cases.  After doing some research I found Chutzpah does provide a mechanism for setting the timeout when using a chutzpah.json configuration file:

image

{
   “TestFileTimeout”: 5000
}

Not so fast!

The tricky part was this didn’t fix the problem immediately.  Since Visual Studio had already performed its test discovery, it didn’t even attempt to read the JavaScript tests that had timed out previously.  But if you open the file in question and just resave it, Visual Studio will re-perform the test discovery step and find the tests if you set the timeout high enough.  If not, you will need to up the timeout and perform these steps again.

I hope this post will help others with the same or similar issues.  If it does or you have further questions please leave a comment below to let me know. 

Happy Testing!

4 thoughts on “Chutzpah Test Adapter – Timeout occurred when executing test file”

  1. Hi, I´ve tried this solution but not working, I see I don´t have chutzpah.json in my solution, but try creating one, but still it not working.

Leave a Reply