Skip to content

fix: remove remaining flaky wall-clock test assertions - #2159

Merged
qinxuye merged 1 commit into
xorbitsai:mainfrom
rogercloud:codex/fix-remaining-timing-assertions
Sep 6, 2026
Merged

fix: remove remaining flaky wall-clock test assertions#2159
qinxuye merged 1 commit into
xorbitsai:mainfrom
rogercloud:codex/fix-remaining-timing-assertions

Conversation

@rogercloud

Copy link
Copy Markdown
Collaborator

Nine remaining tests could fail when a CI worker was descheduled: four event-loop tests used short sleeps or ticker counts, and five timeout tests imposed 3–5 second wall-clock ceilings.

Replace the event-loop timing assertions with worker-entry and release events (or the existing pool checkout gate). Keep checking timeout outcomes and configured deadlines, with 30-second test guards for hangs. Preserve the thread-CPU performance regression tests.

Validation: 144 relevant tests passed across two runs; Ruff lint, format checks, and git diff --check passed. The API run used an isolated import path because the shared editable virtualenv otherwise loaded both checkouts.

Follow-up to #2156, which merged while this audit was in progress.

@XprobeBot XprobeBot added the bug Something isn't working label Sep 6, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors several asynchronous tests to eliminate flaky time-based assertions and background ticker tasks. Instead of relying on arbitrary sleep durations and measuring elapsed time, the tests now use deterministic synchronization primitives such as threading.Event and asyncio.Event along with explicit pytest.mark.timeout decorators. This ensures robust and reliable test execution across different environments. There are no review comments to address, and I have no additional feedback to provide.

@qinxuye qinxuye 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

@qinxuye
qinxuye added this pull request to the merge queue Sep 6, 2026
Merged via the queue into xorbitsai:main with commit b2b0dc0 Sep 6, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants