Repository navigation
Run the hung-resolve contract test on a fake clock (#1006) - #1533
Conversation
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 39 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… fake-clock pump (Refs #1006) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Closes #1006
Part of #929. Most of #1006 already landed on main (#1049 moved the late-match resolve and late screenshot tests onto a fake clock, and the expect, wait-for, and mobile observation tests already use one). This PR moves the last real-clock deadline race in the LocatorEngine contract tests onto the fake clock.
What changed
tests/E2E.Tests/LocatorEngine/SlowLocate.cs: new test helperHangAsync(FakeTimeProvider clock, TimeSpan budget). It moves the clock by the whole budget and ends withOPERATION_TIMEOUT, so a hang costs no real time. Port-only test helper, no upstream symbol (test-only).tests/E2E.Tests/LocatorEngine/LocatorEngineResolveRetryContractTests.cs:Keeps_a_resolve_that_hung_with_budget_to_spare_a_timeout_never_a_missing_nodenow runs on aSteppingTimeclock, not a real 2 s deadline with realTask.Delaywaits. Test name and assertions (ACTION_FAILED, two resolves) are unchanged.Upstream parity
packages/e2e/tests/unit/locator-engine.test.ts, testkeeps a resolve that hung with budget to spare a timeout, never a missing node.sleep(100)and a never-resolving promise against a realDeadline(2_000). The port keeps the test name and assertions and replaces only the timing mechanism with a fake clock, because the real-clock version was the flake. Reported here as a justified exception.SlowLocate.HangAsync(FakeTimeProvider, ...)), reason: lets the test run without real waits.CLAUDE.mdparity rules concernsrc/symbols and test layout. This change touches nosrc/file and adds no test, so no symbol mapping or layout change applies.Verification
dotnet format --verify-no-changeson the two files: clean (LF, matching.editorconfig).dotnet test tests/E2E.Tests --filter "FullyQualifiedName~LocatorEngine|FullyQualifiedName~LocatorWaitFor|FullyQualifiedName~ExpectPoll": 106 passed, 0 failed.RealModelsuite. This change is test-only and does not touch the agent, prompts, cache, replay, or the page script, soCLAUDE.mddoes not require it.🤖 Generated with Claude Code
Summary by CodeRabbit