Skip to content

TEST: Make Docker timeout phase classification deterministic - #4115

Merged
Richard Lundeen (richlundeen) merged 1 commit into
microsoft:mainfrom
richlundeen:test-docker-timeout-phases-20261109
Nov 9, 2026
Merged

Richard Lundeen (richlundeen) merged 1 commit into
microsoft:mainfrom
richlundeen:test-docker-timeout-phases-20261109

Conversation

@richlundeen

Copy link
Copy Markdown
Contributor

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.

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>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Nov 9, 2026
Merged via the queue into microsoft:main with commit 4fc6813 Nov 9, 2026
55 checks passed
@richlundeen
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>
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.

3 participants