Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading 2.0.2 -> 2.0.3 - promise warning/exception #3056

Closed
DaveO-Home opened this issue Jun 20, 2018 · 6 comments
Closed

Upgrading 2.0.2 -> 2.0.3 - promise warning/exception #3056

DaveO-Home opened this issue Jun 20, 2018 · 6 comments

Comments

@DaveO-Home
Copy link

Expected behaviour

No warning : karma executes successfully after the promise fails, just stalls the process......

Actual behaviour

Getting:

START:
(node:5540) Warning: a promise was created in a handler at /home/daveo/NetBeans/acceptance-tests-vue/public/node_modules/karma/lib/server.js:122:24 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.cast (/home/daveo/NetBeans/acceptance-tests-vue/public/node_modules/bluebird/js/release/promise.js:196:13)

Environment Details

  • Karma version (output of karma --version):
    2.0.3
  • Relevant part of your karma.config.js file

Steps to reproduce the behaviour

  1. using gulp - task looks like this;
gulp.task('pat', ['build-development'], done => {
    if (!browsers) {
        global.whichBrowsers = ["ChromeHeadless", "FirefoxHeadless"];
    }

    return runKarma(done);
});

function runKarma(done) {
    let sPromise = new Server({
        configFile: __dirname + '/karma_conf.js',
        singleRun: true
    }, result => {
        var exitCode = !result ? 0 : result;
        if (typeof done === "function") {
            done();
        }
        if (exitCode > 0) {
            process.exit(exitCode);
        }
    }).start();
}
@DaveO-Home DaveO-Home changed the title Upgrading 2.0.2 -> 2.0.3 - promise waring/exception Upgrading 2.0.2 -> 2.0.3 - promise warning/exception Jun 20, 2018
@johnjbarton
Copy link
Contributor

Seems like you need to return the promise:

let sPromise = new Server({...

to

return new Server({...

or

const sPromise = new Server({...
return sPromise;

@DaveO-Home
Copy link
Author

@johnjbarton - pretty quick on the draw. The sPromise has nothing to do with it, the done() does.
The issue is with karma while starting up the server. I put the sPromise there just trying to figure out what's going on, the test eventually finishes successfully. It's just that the new release interrupts things with the it's own promise warning...see my original post.

@johnjbarton
Copy link
Contributor

karma/lib/server.js:122 is
https://github.com/karma-runner/karma/blob/master/lib/server.js#L122

Where's the promise?

Plus the test in #3055 calls new Server().start() and no error.

So we need more hints on where that error is really coming from.

@johnjbarton johnjbarton reopened this Jun 20, 2018
@johnjbarton
Copy link
Contributor

johnjbarton commented Jun 20, 2018

Ok here's another shot: this is a duplicate of #3053

In 2.0.2 there was:

Server.start = function (cliOptions, done) {	
  var server = new Server(cliOptions, done)	
  server.start()	
}

The feature was fixed in #3055

@DaveO-Home
Copy link
Author

DaveO-Home commented Jun 20, 2018

@johnjbarton - I'm running on Linux Fedora 28 and node v8.9.4, if that matters. And I'm not using the static method - I haven't pushed the new version out, but if you want to see the various bundlers/gulp setups I'm using, my demo is github.com/DaveO-Home/embedded-acceptance-tests-vue - this is not a show stopper for me, just an irritation. I have no idea what this is; bluebird/js/release/promise.js

@DaveO-Home
Copy link
Author

I down graded to 2.0.2 and the warning did not show.
I upgraded my Canjs app to 2.0.3 and the warning showed.
Comparison of bluebird

├─┬ karma@2.0.3
 ├── bluebird@3.5.1 
 └─┬ log4js@2.9.0
   └─┬ amqplib@0.5.2
     └── bluebird@3.5.1

├─┬ karma@2.0.2
 ├── bluebird@3.5.0  deduped
 └─┬ log4js@2.9.0
   └─┬ amqplib@0.5.2
     └── bluebird@3.5.0  deduped

Wondering what changed in bluebird.

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

No branches or pull requests

2 participants