Mark the E2B host-fake reap polling sleep as timing-dependent coverage

Merged
DO
2mo ago
+1-1

Part of #8898. Follows #8987, which fixed the same pattern in the Lambda test.

What failed

main CI's coverage job failed after #8812 (run 36493656719): tests/harness/e2b_sandbox/test_backend.py at 99.87%, line 323 missing.

Why

Line 323 is the await anyio.sleep(0.01) in the polling loop of test_host_fake_close_ends_background_children_of_a_finished_launcher. Whether it runs depends on whether the orphaned child is already reaped on the first os.kill(child, 0) check, so coverage of that line is timing-dependent.

Fix

Mark it # pragma: lax no cover, the repo's marker for lines that may or may not run (as in tests/harness/aws_lambda/test_aws_lambda.py).

Verification

  • uv run pytest tests/harness/e2b_sandbox/test_backend.py: 130 passed
  • pre-commit on the changed file (the repo-wide typecheck hook was skipped locally: it fails in this environment on tests/test_embeddings.py for missing optional packages, unrelated to this change; CI runs it)

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
  • PR title is fit for the release changelog.

šŸ¤– Generated with Claude Code

https://claude.ai/code/session_01E2vP6G2QaFiPBkfY2vQBW8