keithmorris / gulp-nunit-runner

A gulp.js plugin to facilitate running nunit tests on .NET assemblies.
MIT License
7 stars 9 forks source link

Error: spawn EBADF with TeamCity #11

Open jkodroff opened 9 years ago

jkodroff commented 9 years ago

My build fails intermittently on TeamCity 9.0.3 (latest at time of writing) with this message (but never in my command line window):

[16:10:08][Step 1/1] child_process.js:1155
[16:10:08][Step 1/1]     throw errnoException(err, 'spawn');
[16:10:08][Step 1/1]           ^
[16:10:08][Step 1/1] Error: spawn EBADF
[16:10:08][Step 1/1]     at exports._errnoException (util.js:746:11)
[16:10:08][Step 1/1]     at ChildProcess.spawn (child_process.js:1155:11)
[16:10:08][Step 1/1]     at Object.exports.spawn (child_process.js:988:9)
[16:10:08][Step 1/1]     at run (C:\TeamCity\buildAgent\work\243a5b945bf3db45\node_modules\gulp-nunit-runner\index.js:116:28)
[16:10:08][Step 1/1]     at Stream.end (C:\TeamCity\buildAgent\work\243a5b945bf3db45\node_modules\gulp-nunit-runner\index.js:31:3)
[16:10:08][Step 1/1]     at _end (C:\TeamCity\buildAgent\work\243a5b945bf3db45\node_modules\gulp-nunit-runner\node_modules\event-stream\node_modules\through\index.js:65:9)
[16:10:08][Step 1/1]     at Stream.stream.end (C:\TeamCity\buildAgent\work\243a5b945bf3db45\node_modules\gulp-nunit-runner\node_modules\event-stream\node_modules\through\index.js:74:5)
[16:10:08][Step 1/1]     at DestroyableTransform.onend (C:\TeamCity\buildAgent\work\243a5b945bf3db45\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:523:10)
[16:10:08][Step 1/1]     at DestroyableTransform.g (events.js:199:16)
[16:10:08][Step 1/1]     at DestroyableTransform.emit (events.js:129:20)
[16:10:08][Step 1/1] Process exited with code 1

This is the gulp task:

gulp.task('test', ['restoreSlnPackages', 'build'], function () {
  return gulp
    .src(['src/**/bin/' + configuration + '/*.Tests.dll'], { read: false })
    .pipe(nunit({
      executable: 'src/packages/NUnit.Runners.2.6.4/tools/nunit-console.exe'
    }));
});

It might have something to do with the fact that my nunit executable is in the solution packaged path.

I'm not even sure this is a gulp-nunit-runner issue, but I thought I might report it here in case anyone could shed any light on the situation.

keithmorris commented 9 years ago

@mikeobrien I don't use TeamCity so I can't troubleshoot this. Since you added the TeamCity reporting, is this something you could take a look at?

mikeobrien commented 9 years ago

I've never seen that before. Sounds like it might be a race condition tho. If you are doing package restore and tests async then I could see that possibly causing this problem.

keithmorris commented 8 years ago

@jkodroff, were you able to get this resolved on your end? I did notice that it looks like you are restoring packages at the same time you are trying to build (the dependencies run concurrently). You might try using something like https://www.npmjs.com/package/run-sequence to run the tasks sequentially instead of concurrently.