-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[8.x] Clean up custom Queue payload between tests #36271
Conversation
So it's not an issue if queue worker states persist between job (one worker may handle different jobs which might not related) and we only need to handle it between tests? |
@crynobone The worker only bootstraps Laravel once and then can run as many job as necessary. The problem is that during tests, Laravel bootstraps and tears down once per test, but the tear down is not clearing the I noticed this problem because the 1st test passes, but the 2nd fails. During the 2nd tests, there are 2 closures bound into the |
models. Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
This reverts commit ac219bf.
Hey @deleugpn - we had to revert this due to some stuff in Telescope. An alternative might be calling Queue::createPayloadUsing(null) in the tearDown method of Laravel's base test case. We already reset some stuff there. |
When executing tests with Data Providers,
Queue::createPayloadUsing
leaks between tests and accumulates callbacks from different environments, leading to unexpected behaviors.This pull request adds a clean up to the TearDown method so that callbacks are not kept between tests.
The test is likely to fail until orchestral/testbench-core#54 is merged as it mimics the same behavior for tests executed from within the framework.