gruntjsgrunt-concurrent

Grunt-concurrent Loops on Failed Task


I've got an interesting problem with Grunt-Concurrent. When a registered task such as Uglify or Karma runs without errors everything is fine. But if Uglification or Karma tests fail then Grunt-Concurrent will continuously loop until the error is fixed. This was annoying with Uglify but with Karma unit tests it's really hard to have it looping until the bug is fixed.

Any ideas of how to solve this?

I can't really provide examples of our exact set up.

It will just keep running with this message until the unit tests all pass:

Running "watch:karma" (watch) task
Waiting...

Running "karma:unit:run" (karma) task
Firefox 39.0.0 (Mac OS X 10.10.0) it should work should work FAILED
Expected true to be false.
...: Executed 2 of 2 (1 FAILED) (0.007 secs / 0.004 secs)
Warning: Task "karma:unit:run" failed.

It then runs it over again and again and again.


Solution

  • Looks like the issue was actually with grunt-contrib-watch and once I started going down that path I found the answer.

    I found this great SO question: Prevent `grunt-watch` from looping when there is a syntax error in less files?

    I found that by changing spawn: true that it no longer loops like it used to.