Skip to content

Stabilize butex stop-after-running test - #3562

Merged
chenBright merged 1 commit into
apache:masterfrom
wasphin:fix-butex-stop-after-running-test
Sep 23, 2026
Merged

chenBright merged 1 commit into
apache:masterfrom
wasphin:fix-butex-stop-after-running-test

Conversation

@wasphin

@wasphin wasphin commented Sep 22, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Problem Summary:

ButexTest.stop_after_running assumes that stopping and joining a task finishes
within 25 ms of a 10 ms sleep. The assertion is sensitive to scheduler delays
and has failed in CI exactly at the 25 ms boundary. The waiter already verifies
that bthread_stop() interrupts butex_wait() with EINTR, which is the
behavior under test.

What is changed and the side effects?

Changed:

Remove the wall-clock timing assertion and its timer while retaining the
EINTR, stop, join, and repeated-stop checks.

Side effects:

  • Performance effects: None.

  • Breaking backward compatibility: No.


Check List:

@wasphin

wasphin commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

The failed clang-unittest-with-bazel job hit the unrelated flaky case SocketTest.socket_buffer_options_before_accept. Its fix is already covered by #3545. I have rerun the failed job and kept this PR scoped to ButexTest.stop_after_running.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

This PR stabilizes the stop_after_running butex test by removing scheduler-sensitive timing validation.

Changes:

  • Removes the timer and wall-clock assertion.
  • Retains EINTR, stop, join, and repeated-stop checks.
File Description
test/​bthread_butex_unittest.cpp Stabilizes the stop-after-running test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chenBright chenBright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@chenBright
chenBright merged commit b4732eb into apache:master Sep 23, 2026
45 of 46 checks passed
@wasphin
wasphin deleted the fix-butex-stop-after-running-test branch September 23, 2026 02:32
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.

3 participants