Skip to content

Fix: make session-timeout test race-free under runner load - #1634

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:fix-session-timeout-load
Aug 2, 2026
Merged

ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:fix-session-timeout-load

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

The driver armed the session timeout at a fixed 3 s, racing the child's pytest startup: on a loaded shared runner (the cpu lane runs 5 T1 jobs in parallel on one box) startup can exceed 3 s, so the timeout dumps the child before it forks and _grandchild_deadlock_sentinel never appears. Tuning the constant (30 s, 300 s) only widens the race window and slows the test.\n\nInstead the dump is now event-driven: the grandchild writes a ready marker the moment it reaches the sentinel, and a driver watcher thread fires the real conftest handler (os.kill(self, SIGALRM)) when the marker appears. The session timeout is demoted to a 60 s fail-safe bound (same as the driver's existing subprocess timeout). The test stays fast (startup + epsilon) and cannot race the startup at any load; a real regression still fails at the 60 s bound with the sentinel missing from the dump.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@ChaoWao, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9fea7649-f651-4c88-8b06-5a245f0b1dce

📥 Commits

Reviewing files that changed from the base of the PR and between 883cfe7 and 787a377.

📒 Files selected for processing (1)
  • tests/ut/py/test_session_timeout.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ChaoWao
ChaoWao force-pushed the fix-session-timeout-load branch from c3868bb to 787a377 Compare August 2, 2026 07:24
@ChaoWao ChaoWao changed the title Fix: make session-timeout test stable under runner load Fix: make session-timeout test race-free under runner load Aug 2, 2026
The driver armed the session timeout at a fixed 3 s, racing the
child's pytest startup: on a loaded shared runner the startup can
exceed 3 s, so the timeout dumps the child before it forks and the
grandchild sentinel never appears. Tuning the constant (30 s, 300 s)
only widens the race window and slows the test.

Instead the dump is now event-driven: the grandchild writes a ready
marker the moment it reaches the sentinel, and a driver watcher fires
the real conftest handler (os.kill(self, SIGALRM)) when the marker
appears. The session timeout is demoted to a 60 s fail-safe bound,
same as the driver's existing subprocess timeout. The test stays fast
(startup + epsilon) and cannot race the startup at any load.
@ChaoWao
ChaoWao merged commit f0e5cba into hw-native-sys:main Aug 2, 2026
16 checks passed
@ChaoWao
ChaoWao deleted the fix-session-timeout-load branch August 2, 2026 07:38
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.

1 participant