Skip to content

test: cover untested wrapper behaviour - #83

Merged
passcod merged 7 commits into
mainfrom
test/coverage-gaps
Nov 11, 2026
Merged

passcod merged 7 commits into
mainfrom
test/coverage-gaps

Conversation

@passcod

@passcod passcod commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

🤖 Adds tests for behaviour that nothing exercised. Each one checks what the code does, rather than just running the lines.

  • std wait_with_output: with only stderr piped, and with both streams piped. On Unix the both-streams test writes more than a pipe's buffer to each, stderr first, so a reader that waited on one stream at a time would deadlock. On Windows, where the fallback reads one stream after the other, the output stays small.
  • KillOnDrop: into_inner() must leave the child running. The Windows kill_on_drop test was never declared as a module, so it never ran. It now checks exit through a process handle, as the job-object tests do, instead of relying on remoteprocess.
  • CreationFlags without JobObject: the flags must reach the process unchanged, which the test shows by the child staying suspended.
  • ResetSigmask: a child spawned from a thread that blocks SIGUSR1 must see no blocked signals. A control test checks that, without the wrapper, the child does inherit the block. Linux only, since it reads /proc/self/status.
  • ProcessGroup::attach_to() and ProcessGroupChild::pgid(): a command attached to a leader's group must end up in that group, and killing the group must take it down.
  • KillOnDrop on Unix: the existing test's dead check used pid_alive (remoteprocess), which reports processes it can't inspect as dead. On macOS that's every process, so the test passed there without checking anything. It now uses kill(pid, 0), and the new into_inner test uses try_wait.

@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.50%. Comparing base (1c4fc62) to head (5d60015).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
+ Coverage   84.68%   91.50%   +6.82%     
==========================================
  Files          19       19              
  Lines        1319     1319              
==========================================
+ Hits         1117     1207      +90     
+ Misses        202      112      -90     
Flag Coverage Δ
macos 88.88% <ø> (+8.54%) ⬆️
ubuntu 89.10% <ø> (+7.97%) ⬆️
windows 92.89% <ø> (+4.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@passcod
passcod marked this pull request as ready for review November 11, 2026 03:45
…s it

The Windows test file was never declared as a module, so it never ran; it
now checks exit through a process handle, as the job tests do.
…wait

pid_alive reports processes it can't inspect as dead, which on macOS is
every process.
pid_alive reported the process as dead on macOS whether or not it was,
so this test passed there without checking anything.
@passcod
passcod merged commit 2f4bc39 into main Nov 11, 2026
24 checks passed
@passcod
passcod deleted the test/coverage-gaps branch November 11, 2026 03: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