Skip to content

test(platform): wait boundedly for the drained Windows descendant to signal - #116

Merged
MrScripty merged 1 commit into
mainfrom
test/windows-drain-descendant-exit-wait
Nov 6, 2026
Merged

MrScripty merged 1 commit into
mainfrom
test/windows-drain-descendant-exit-wait

Conversation

@MrScripty

Copy link
Copy Markdown
Owner

Fixes an intermittent Windows CI failure that hit #111 and #113 today:

platform::managed_child::windows_tests::suspended_admission_assigns_descendants_to_job_and_drains_them
panicked at crates\pumas-core\src\platform\managed_child.rs:1488:9:
  left: 258   (WAIT_TIMEOUT)
 right: 0     (WAIT_OBJECT_0)

Cause

After terminate_and_drain, the test checked the descendant's process handle with a 0 ms WaitForSingleObject. Drain completes when the Job's ActiveProcesses reaches zero (terminate_and_has_members). Windows can drop that count slightly before the terminated process object is signaled, so the immediate check sometimes caught that gap.

Fix

Wait up to 5 s instead of 0 ms. The test still asserts that the descendant was in the admitted Job, that it was terminated by the drain, and that the Job has no members afterwards. No product code changes. Pumas holds no handle to arbitrary descendants, so the Job count stays the drain's completion signal.

Verification

  • cargo check --tests --target x86_64-pc-windows-gnu -p pumas-library passes. This test is cfg(windows), so Windows CI is what runs it.
  • cargo fmt --check is clean.

🤖 Generated with Claude Code

…signal

suspended_admission_assigns_descendants_to_job_and_drains_them polled
the terminated descendant's process handle once with a zero timeout
right after terminate_and_drain. Drain completes when the Job reports no
active processes, and Windows can drop that count shortly before the
terminated process object is signaled, so the poll intermittently
returned WAIT_TIMEOUT (258) on CI (#111 and #113 runs on 2026-11-06).

Wait up to five seconds instead. The test still proves the descendant
was assigned to the Job and terminated by the drain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4a8428df-b8eb-483a-b4d3-f9e3e42fae91
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

The Windows descendant-drain test now waits up to five seconds for the descendant’s process handle to signal instead of checking it immediately.

  • The Windows drain test waits up to five seconds for descendants to signal.

Reviews (1) · Last reviewed commit: "test(platform): wait boundedly for the d..." · Reviewed by Greptile

@MrScripty
MrScripty merged commit 5259ea5 into main Nov 6, 2026
35 checks passed
@MrScripty
MrScripty deleted the test/windows-drain-descendant-exit-wait branch November 6, 2026 19:55
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