Repository navigation
TEST: Make Docker timeout phase classification deterministic - #4115
Merged
Richard Lundeen (richlundeen) merged 1 commit intoNov 9, 2026
Conversation
Drive capture and post-EOF client deadlines explicitly without changing production timeout behavior. Cover cooperative scheduling and preserve startup/shared-deadline contracts and cleanup assertions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the test-only changes that make Docker timeout-phase testing deterministic.
No open issues 🎉
What changed in this PR
This test-only PR makes Docker timeout-phase classification deterministic without changing production timeout behavior. It addresses a scheduling race not resolved by #4102’s per-invocation timeout plumbing.
Changes:
- Replaces the 50 ms timing dependency with explicit capture and client-wait phase selection.
- Adds startup-expiry and shared-deadline budget checks.
- Exercises scheduling variations and strengthens output, task-completion, and cleanup assertions.
| File | Description |
|---|---|
tests/unit/_code_execution/test_docker_client.py |
Makes timeout-phase tests deterministic while preserving real capture, classification, and cleanup paths. |
Review effort: Balanced
Justin Song (jsong468)
approved these changes
Nov 9, 2026
Richard Lundeen (richlundeen)
deleted the
test-docker-timeout-phases-20261109
branch
November 9, 2026 22:53
Richard Lundeen (richlundeen)
added a commit
to richlundeen/PyRIT
that referenced
this pull request
Nov 10, 2026
Integrate main at 15afd46. Preserve the existing microsoft#4115 deterministic Docker classification tests together with the inherited Sandbox adaptation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make the Docker timeout-classification tests select capture-expired and post-EOF client-expired phases deterministically instead of requiring capture scheduling to fit within fifty milliseconds. Preserve the real capture and classification paths, cleanup assertions, and intentional shared-deadline coverage without changing production timeout behavior.
Related to #4102, whose per-invocation timeout plumbing does not itself remove this test's phase-selection race.