Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis CI build terminated 10 minutes after Mocha v4 tests pass

I'm using Travis CI and Mocha. My tests pass locally with no issues.

When I push to Github the Travis CI process starts, the tests run and successfully pass, then nothing. The Travis console shows nothing for about 10 minutes and then outputs:

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself. Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

My initial thought the issue was due to a faulty test. After removing all tests the Travis CI build completes successfully in about 50 seconds. So I know the build works.

I then added a super simple test - to request my root page and check for a 200 status. Again the test passes locally. The Travis CI build starts, the test passes, then it hangs for 10 minutes and displays the message above.

Additionally, the build was previously working using these same tests. The only thing I can think that changed was I cleared node_modules and ran npm install again.

Currently using Node v8.7.0 with Mocha v4.0.0.

Why does Travis hang and eventually terminate the build even when the tests are passing?

like image 931
Brett DeWoody Avatar asked Dec 05 '17 15:12

Brett DeWoody


1 Answers

Total newb here, but I recently encountered this exact issue while building a node app. All tests passing but the build would just hang. It was driving me nuts.

Apparently the upgrade from Mocha v3 to Mocha v4 is causing the issue. See here for some folks with the same question on github: https://github.com/mochajs/mocha/issues/3044

For a quick fix, in your package.json file, use mocha --exit.

like image 163
Kayla W. Avatar answered Sep 19 '22 14:09

Kayla W.