Code Monkey home page Code Monkey logo

Comments (3)

novemberborn avatar novemberborn commented on June 7, 2024 1

This was discussed here: #3260 (comment)

But I'll use this as the tracking issue.


I run integration tests with a local database and want to keep the database pool open.

Since each test file runs in its own isolated worker thread, I don't think this will make a difference.

In 5.3.1, this worked fine but it breaks after upgrading and no other changes on my end.

Yes this was a change in AVA 6. It's listed under the Breaking Changes in the release notes:

When tests finish, worker threads or child processes are no longer exited through proces.exit(). If your test file does not exit on its own, the test run will time out.

Please enable some kind of way to set up the configuration to forcibly exit and pass if all tests ran & passed

See suggestion at #3260 (comment):

I think a import { registerCompleteHandler } from 'ava' which sets up a function to be called when AVA is done would be a decent solution. You could then registerCompleteHandler(() => process.exit()) and AVA will just assume the test worker exited on its own. This could be in a helper file that is loaded.

Other use cases are as a cleanup routine that sits outside of AVA's test & hook logic. I'm leaning to a solution like this over configuration because configuration implies we can handle edge cases in Node.js and we can't.

from ava.

novemberborn avatar novemberborn commented on June 7, 2024

@croconut let me know if #3283 works for you.

from ava.

croconut avatar croconut commented on June 7, 2024

@novemberborn thanks a bunch, I'll give this a shot

from ava.

Related Issues (20)

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.