Repository navigation
test: replay seeded events before live ones in run state reconciliation tests - #2054
Conversation
There was a problem hiding this comment.
Claude Code Review
Claude Code Review is paused for this repository because its GitHub organization is not linked to your Claude organization.
To turn it back on, one person needs both roles: owner of the GitHub organization (or the account owner, for a personal repository) and admin or owner of your Claude organization. If that is not you, pass this on to someone who is.
Open Organization settings, Git providers and click Link next to the GitHub organization's name. If it is not listed, click Enable GitHub integration or Connect your GitHub first, whichever the page shows.
New pull requests are then reviewed as before. To get a review on one that is already open, someone with write access can comment @claude review.
Tip: disable this comment in your organization's Code Review settings.
Pull Request
Related Issue
Description
Problem. Two tests in
test/unit/service/runStateReconciliation.test.tsfail onmain:CI did not catch it because the frontend job runs only the test files a pull request changes, and this file was not changed.
Cause. Since #1969, a Run's companion event stream resumes from the older of the timeline and the Run state it keeps in step with, so that both receive every event. In these tests the Run state comes from a summary, which carries no event sequence, so the stream starts from the beginning and the server would replay events 1 and 2 first. The tests still sent event 3 right away, which the stream correctly treats as a gap.
Fix. Test-only. Both tests now replay the seeded events 1 and 2 before event 3, as the server does, and a helper checks that the stream starts from the beginning. The app code is unchanged.
Testing Evidence (REQUIRED)
npx vitest run test/unit/service/runStateReconciliation.test.ts: 44 passed (2 failed before).ESLint and Prettier pass on the changed file.
I have included human-verified testing evidence in this PR.
This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
No frontend/UI changes in this PR.
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement