Git Product home page Git Product logo

Comments (7)

nathanboktae avatar nathanboktae commented on June 8, 2024 1

It does account for that by emitting another event called exit after the process actually exits here. You should wait for that event before exiting your grunt task.

from mocha-chrome.

shellscape avatar shellscape commented on June 8, 2024

Hm, I don't have that issue on my end. If you can create a failing test case and a fix, please submit a PR for both.

from mocha-chrome.

Spongman avatar Spongman commented on June 8, 2024

i just based my code off the test code here: https://github.com/shellscape/mocha-chrome/blob/master/test/api.js. is there another, more complete sample i can use that works correctly in this case?

from mocha-chrome.

Spongman avatar Spongman commented on June 8, 2024

also, if the close() promise isn't ever getting resolved, when does the this.instance.kill(); line run?

maybe i'm missing something, but i don't see how this can ever work in the test failure case.

from mocha-chrome.

nathanboktae avatar nathanboktae commented on June 8, 2024

that should also wait for exit. It's just a race condition if you're listening on just ended. Mocha doesn't exit anymore explicity, so without --exit it should actually eventually wait for all the chrome processes to exit. I bet there are multiple at a time, and maybe the CI test run does have a process hanging around.

from mocha-chrome.

Spongman avatar Spongman commented on June 8, 2024

It does account for that by emitting another event called exit after the process actually exits here

i think you're missing my point: that code never gets called.

mocha-chrome/index.js

Lines 158 to 161 in 0f596aa

await this.client.close();
await this.instance.kill();
this.bus.emit('exit', 1);

the first await (L158) results in a Promise being returned from that function, but (in the test failure case) that Promise is promptly dropped on the floor (by Nanobus). it is never resolved and neither L159 nor L161 are executed. there's no race condition. the exit bus event is never fired.

from mocha-chrome.

shellscape avatar shellscape commented on June 8, 2024

@Spongman a better way to handle your frustration (that's what I'm sensing) would have been to create a failing test case and submit a fix for it. of course, there are always alternatives you can also use, including mocha-headless-chrome which works in a similar manner. this is a community-run, open-source project that people donate their time to when they can. it's free, and we're not always going to be able to predict, nor understand what someone else is reporting, so community contributions are key to improving the project. please bear that in mind in the future for any project you use.

from mocha-chrome.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.