Skip to content

Rework spec checking for active job leaks to handle new ActiveJob::TestHelper implementation - #2919

Merged
JonRowe merged 2 commits into
mainfrom
fix-active-job-leak-spec
Sep 3, 2026
Merged

JonRowe merged 2 commits into
mainfrom
fix-active-job-leak-spec

Conversation

@JonRowe

@JonRowe JonRowe commented Sep 3, 2026

Copy link
Copy Markdown
Member

Rails 8.2 changed the active job test helper in such a way that in certain load orders, the adapter for ActiveJob::Base is cached, this implementation then overrides the configuration which results in our setup during a regression test for checking that queues don't leak between jobs breaking because the job and test have different queues, and the test never sees the job at all let alone leak.

You can verify this locally by using a seed such as 40770, or running the spec in isolation and changing the assertion for the adapter to:

expect {
  ActiveJob::TestHelper::TestQueueAdapter.reset
}.to change { ActiveJob::Base.queue_adapter }.to(test_adapter)

@JonRowe
JonRowe merged commit 003b5b3 into main Sep 3, 2026
12 of 14 checks passed
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

Successfully merging this pull request may close these issues.

1 participant