Skip to content

Fix Delayed Job hook spec order dependency#1539

Merged
unflxw merged 1 commit into
mainfrom
fix-delayed-job-hook-spec-order
Jul 9, 2026
Merged

Fix Delayed Job hook spec order dependency#1539
unflxw merged 1 commit into
mainfrom
fix-delayed-job-hook-spec-order

Conversation

@unflxw

@unflxw unflxw commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The "adds the plugin" example relied on start_agent installing 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 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.

[skip changeset]

@backlog-helper

backlog-helper Bot commented Jul 9, 2026

Copy link
Copy Markdown

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

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
unflxw force-pushed the fix-delayed-job-hook-spec-order branch from 46655e6 to 0d98b0e Compare July 9, 2026 16:40
@unflxw
unflxw requested review from Copilot, lipskis and tombruijn July 9, 2026 16:48
@unflxw
unflxw merged commit 5e9f3e1 into main Jul 9, 2026
235 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_agent usage in spec/lib/appsignal/hooks/delayed_job_spec.rb with a direct described_class.new.install call 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.

@tombruijn tombruijn added the chore A small task that takes a day or two at the most. label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A small task that takes a day or two at the most.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants