Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Gulp task times out #38

Open
thany opened this issue Mar 1, 2017 · 4 comments
Open

Gulp task times out #38

thany opened this issue Mar 1, 2017 · 4 comments

Comments

@thany
Copy link

thany commented Mar 1, 2017

When I implement the karma-runner as simply as I can with a console.log in there:

gulp.task("test", function(done) {
  new karma.Server({
    configFile: __dirname + "/karma.conf.js",
    singleRun: true
  }, function(exitCode) {
    console.log("Exit code: " + exitCode);
    done();
  }).start();
});

And I run it, the task says:

[10:47:05] Using gulpfile d:\Klanten\qsdashboard\gulpfile.js
[10:47:05] Starting 'test'...
01 03 2017 10:47:06.004:INFO [karma]: Karma v1.5.0 server started at https://0.0.0.0:9876/
01 03 2017 10:47:06.005:INFO [launcher]: Launching browser Chrome with unlimited concurrency
01 03 2017 10:47:06.010:INFO [launcher]: Starting browser Chrome
01 03 2017 10:47:06.597:INFO [Chrome 56.0.2924 (Windows 10 0.0.0)]: Connected on socket UhjTEzLZZfWqm6KOAAAA with id 95600418
Chrome 56.0.2924 (Windows 10 0.0.0): Executed 12 of 12 SUCCESS (0.06 secs / 0.051 secs)
Exit code: 0
[10:47:06] Finished 'test' after 1.06 s

So that's all good and dandy! However, gulp itself doesn't return me to the prompt. That on its turn, takes another 2 full minutes.

This task is the only one suffering from this problem. I've written others, and they all finish instantly after gulp's Finished message. I've also tried returning a promise, but the result is the same. I've also tried returning the server (return new karma.Server...) to no avail.

Now sure, I can hit Ctrl+C after the task is finished, but this is going to be running in a CI environment, and I don't want to hog the build runners there. My coworkers won't be happy with that :)

So it'd be nice to solve this problem.
Some versions used:

  • NodeJS 7.6.0
  • NPM 4.1.2
  • Karma 1.5.0
  • Karma-jasmine 1.1.0
  • Gulp 3.9.1
@code-mattclaffey
Copy link

Having the same issue using:

NodeJS: 4.4.7
Karma: 1.5.0
Gulp: 3.9.1

@code-mattclaffey
Copy link

Using [email protected] with gulp @3.9.1 & [email protected] will not have the lag. I think it is an issue with the latest version.

@happyCoda
Copy link

Just have encountered the same problem. But I've noticed, that mine happens only if my tested files logs something in browser (Phantomjs) console. If it don't everything works like a charm. So as a workaround for this problem you can try to switch off capturing browser logs in your karma.conf:
client: { captureConsole: false }

@johannesjo
Copy link

No updates here? Takes ages for my karma instance to finally exit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants