Add tests for Sidekiq::Process signal pushing and status helpers by hammadxcm · Pull Request #7031 · sidekiq/sidekiq · GitHub
Skip to content

Add tests for Sidekiq::Process signal pushing and status helpers - #7031

Merged
mperham merged 1 commit into
sidekiq:mainfrom
hammadxcm:test-process-signals-status
Jun 10, 2026
Merged

mperham merged 1 commit into
sidekiq:mainfrom
hammadxcm:test-process-signals-status

Conversation

@hammadxcm

Copy link
Copy Markdown
Contributor

Summary

Four cohesive tests for Sidekiq::Process's signal/status API — the contract behind the Web UI's per-process Quiet/Stop/Dump Threads buttons. The existing test for quiet!/stop! only asserts they raise on embedded processes; the actual signal-pushing side effect was never verified.

  • quiet! pushes TSTP onto the <identity>-signals list with a 60s TTL (the contract that lets the running process pick up the signal without the list ever growing).
  • stop! + dump_threads push TERM and TTIN onto the same per-identity signals list (and we confirm lpush ordering newest-first).
  • stopping? reflects the quiet attribute in the process info hash ("true" string → true, anything else → false).
  • leader? compares the process identity to the dear-leader Redis key — true only when the identity matches.

Test-only, no lib/ changes.

Testing

bundle exec rake is green (standard + lint:herb + full suite).

Four cohesive tests for Process's signal/status API — the contract
behind the Web UI's per-process Quiet/Stop/Dump Threads buttons:

- quiet! pushes 'TSTP' onto the <identity>-signals list with a 60s
  TTL (the contract that lets the running process pick up the signal
  without ever growing the list).
- stop! pushes 'TERM' and dump_threads pushes 'TTIN' onto the same
  per-identity signals list.
- stopping? reflects the 'quiet' attribute in the process info hash
  ('true' string -> true, anything else -> false).
- leader? compares the process identity to the dear-leader Redis key
  (returns true only when the identity matches).
@mperham
mperham merged commit 48c33e0 into sidekiq:main Jun 10, 2026
17 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.

2 participants