Fix Delayed Job hook spec order dependency#1539
Merged
Merged
Conversation
|
✔️ All good! |
The "adds the plugin" example relied on `start_agent` installing the process-global Delayed Job hook, which installs once and is never reset. Once another spec installed it first (e.g. the integration spec under a different run order), the example saw an empty stubbed worker and failed. It only passed because `hooks/` sorts before `integrations/`. Install the hook directly in the example, like the Shoryuken hook spec, so it no longer depends on global state or run order.
unflxw
force-pushed
the
fix-delayed-job-hook-spec-order
branch
from
July 9, 2026 16:40
46655e6 to
0d98b0e
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes an order-dependent test setup in the Delayed Job hook spec by installing the hook directly in the example, avoiding reliance on start_agent’s process-global hook installation behavior.
Changes:
- Replace
start_agentusage inspec/lib/appsignal/hooks/delayed_job_spec.rbwith a directdescribed_class.new.installcall after stubbing Delayed Job constants. - Add an explanatory comment documenting the previous run-order dependency and aligning the approach with the Shoryuken hook spec pattern.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "adds the plugin" example relied on
start_agentinstalling the process-global Delayed Job hook, which installs once and is never reset. Once any other spec installed it first (e.g. the integration spec under a different run order), the example saw an empty stubbed worker and failed. It only passed becausehooks/sorts beforeintegrations/.Install the hook directly in the example, like the Shoryuken hook spec, so it no longer depends on global state or run order.
[skip changeset]