-
Notifications
You must be signed in to change notification settings - Fork 210
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
Disposing miniflare@3 when a queue is running #627
Comments
In fact, it negatively impacts our tests and makes them unreliable, we are exploring why, but in the mid-time, we had to disable the queues for our tests. |
Hey! 👋 Great catch, thanks for reporting this. We should probably update |
Hmmm, alternatively, could you wait for some side effect of your queue handler in your tests? Presumably, the tests should only pass (and then dispose), once the queued message has been processed? |
Potentially but hard to write, especially as we have multiple queues.
In some cases, yes, in others, the queue is just a side effect.
Or expose a function like |
The main issue here is that it's an uncaught exception, it makes it very hard to integrate it in jest (jestjs/jest#10364). One alternative could be to let us easily handle these "async" errors, with something like: const miniflare = new Miniflare();
miniflare.on('exception', () => {
// Log it and ignore
}); |
Hey! 👋 I think this should've been fixed by #656. The queue dispatcher is now implemented in |
When writing unit tests where each test uses its own miniflare instance (for isolation), meaning the miniflare instance is disposed at the end of the tests, we can observe the following logs:
It doesn't prevent the tests from working, but it's verbose. Maybe there is an opportunity to improve the lifecycle when disposing a worker with messages in the queue.
The text was updated successfully, but these errors were encountered: