Repository navigation
tests: one injected FakeClock for the tend fakes (Refs #5200) - #5201
Merged
Merged
Conversation
…depends on the wall clock (Refs #5200) V2TendProposeTests 'an uncertain post is never repeated' fixed the fake GitHub's comment time at 2026-11-01T12:00:00Z but ran the tend with TimeProvider.System, so after 12:00Z the posted comment looked older than the post and the run stayed uncertain. The fake GitHub now stamps comments from the same FakeClock the tend context reads (Clock and Pacer), and the write tests use it too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
Root/fdev review: APPROVE
Proportionate review for a test-only fix to a red main. Merging. Refs #5200 |
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.
Refs #5200
Root cause
V2TendProposeTests"an uncertain post is never repeated, and the next run finds it by its run marker" (from #5161) fixedTendFakeGitHub.Now = "2026-11-01T12:00:00Z"(the comment'screatedAt) while the tend context ran onClock = TimeProvider.System.V2TendPropose.findPostedonly accepts a comment whosecreatedAtis within a minute of the pending post's recorded time (the run clock). From 12:00Z on 2026-11-01 the real clock is past the fixture, so the posted comment looked older than the post and the run returneduncertaininstead ofverified. Red on main and every PR running coord-enginechange-completenessand coord-githubedge.Change (tests only, no source change)
TendFakeGitHub.fs: newFakeClock(aTimeProviderthat never reads the system clock; UtcNow and the monotonic timestamp follow one settable instant).Boardtakes it (Board()keeps working on the anchor 2026-11-01T12:00Z), stamps proposal comments from it, and exposes it asboard.Clock. The fixedNowstring is gone.V2TendProposeTests.fs,V2TendWriteTests.fs: the tendContextClock and Pacer useboard.Clock. Sweep fixes: the other fixed 2026-11-01T12:00Z literal (someone-else comment) now derives from the clock;UpdatedAt = DateTimeOffset.UtcNowin the S3 deciding-PR test now uses the fake clock; the snapshot and planObservedAtuseFakeClock.Anchor. The Pacer now runs on the fake monotonic timestamp instead of Stopwatch.Sweep result
V2TendReadsTests, V2TendTests and cli-join TendApplicationTests pass an explicit
observedand compare no fixed fixture time to a real clock (TendApplicationTests uses TimeProvider.System only against an empty fake board with no timestamps compared). The projection migration tests useUtcNowrelative offsets, not fixed-vs-real; not tend and unchanged.Fixture clocks (lifecycle-contract fixture rule)
Every tend fixture time derives from the injected
FakeClock(anchor 2026-11-01T12:00:00Z unless a test passes another); none reads the system clock.Checks run locally
dotnet test tests/coord-board-v2-projection: 307 passed (incl. the new Theory).dotnet test tests/coord-board-v2-cli-join: 103 passed.🤖 Generated with Claude Code