Repository navigation
test: reuse AgentTask and instruction Session fixtures - #1240
Merged
yyjeqhc merged 2 commits intoOct 21, 2026
Merged
Conversation
yyjeqhc
deleted the
refactor/reuse-agent-task-and-session-test-fixtures
branch
October 21, 2026 08:27
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.
Why
AgentTask tests repeatedly prepared the same CodingAgent binding/dispatch and wake-capable Endpoint. Four Session instruction tests also repeated Runner registration and StartSession setup. These copies obscured the scenario-specific fences and assertions.
Changes
Production behavior is unchanged. All 52 AgentTask tests and 7 Session instruction tests remain. Static token comparison also confirms that all 403 + 62 assertion invocations are unchanged.
Reduction
Independent of #1239; both branches start at
7b35aafb0603fb445f9d3f86ab05b2dcf977a1db. This PR changes two Rust test files, the Windows CI scheduling, and its coverage guard.MSI's installed Rust
cloc 0.6.2reports 5,685 → 5,439 code lines in these two files: 246 fewer code lines. Physical diff counts include blank lines and comments.Follow-up: Windows CI failure after the previous merge
The main run at the shared base failed in
runner_windows_local_persistent_shell_preserves_state_and_existing_protocol: opening returnedshell_reset_requiredbefore the first protocol assertion. See the failed Windows Runner job.The failure interval is consistent with the fixed 30-second initialization deadline while the second harness thread runs Plugin child-process fixtures. The original diagnostic combines timeout and lost-control outcomes, so the log alone does not prove which occurred. The unchanged test passes in isolation on MSI in 2.04 seconds.
Run that existing regression in a separate exact-filtered CI step, and exclude only that case from the general Runner/LSP/Computer step. Both use the original
runner-real-process-testsfeature. A CI policy test checks that the excluded case matches the isolated case and still names a non-ignored Rust test. Production deadlines, synchronization, failure handling, and protocol assertions remain unchanged.Validation
Validated on Windows MSI in the existing checkout and target cache:
cargo test --locked -p webcodex-store --lib agent_task_tests:: -- --nocapture: 52 passed.cargo test --locked -p webcodex --lib tool_runtime::tests::sessions_instructions:: -- --nocapture: 7 passed.cargo fmt --all -- --checkandgit diff --cached --check: passed.Independent review of helper ownership, generation fences and operation ordering found no blocking issues. Static comparison retained all 59 test names and all 465 assertion invocations.
The workflow's adjusted broad Windows Runner/LSP/Computer command: 1,171 passed, 72 existing ignored; the single excluded protocol case runs in the next step.
The workflow's isolated persistent-shell command, with
runner-real-process-tests: 1 passed in 1.22 seconds.Python 3.12 CI ownership and release-readiness suites: 28 passed.
GitHub's Windows Runner job on
e7c4b5a1passed both steps: 1,171 + 1 tests passed. The isolated protocol case finished in 4.08 seconds on the hosted Windows runner.The full workspace and macOS suites were not run locally. The initial attempt to run the policy suites with MSI's default Python 3.9 could not import an existing release helper that uses Python 3.12 syntax; the final 28-test run used MSI's installed Python 3.12 and passed.