Skip to content

test: add interrupt wait tests - #41

Merged
Sjors merged 2 commits into
2140-dev:masterfrom
xyzconstant:interrupt-wait-tests
Sep 28, 2026
Merged

Sjors merged 2 commits into
2140-dev:masterfrom
xyzconstant:interrupt-wait-tests

Conversation

@xyzconstant

@xyzconstant xyzconstant commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Update mining_wait_tip_changed and mining_block_template_lifecycle test cases to:

  1. Call waitTipChanged/waitNext on a local task so it is blocked until these methods return. With no timeout, it waits for actual server state changes (new tip or new template).
  2. Call interrupt/interruptWait to wake the server-side wait so the local tokio task returns.
  3. Assert that the wait call was interrupted.

This PR also removes an interrupt call that wasn't interrupting anything.

`mining_check_block_and_interrupt` calls interrupt() while nothing
is waiting, so it only checks that the call doesn't fail. Rename it
to `mining_check_block`.
Call `waitTipChanged` and `waitNext` with no timeout, let them block
in a local task, then check that `interrupt` and `interruptWait`
unblock them.
@Sjors

Sjors commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

ACK f3f1f8f

@Sjors
Sjors merged commit f3f1f8f into 2140-dev:master Sep 28, 2026
1 check passed
@plebhash plebhash mentioned this pull request Oct 23, 2026
bit-aloo pushed a commit that referenced this pull request Oct 23, 2026
`mining_check_block_and_interrupt` calls interrupt() while nothing
is waiting, so it only checks that the call doesn't fail. Rename it
to `mining_check_block`.

Github-Pull: #41
Rebased-From: 909aed9
bit-aloo pushed a commit that referenced this pull request Oct 23, 2026
Call `waitTipChanged` and `waitNext` with no timeout, let them block
in a local task, then check that `interrupt` and `interruptWait`
unblock them.

Github-Pull: #41
Rebased-From: f3f1f8f
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