You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(seen): fill the store in one write before testing its limit - #3830
server/seen.test.ts "read finishes shared by the browsers of a server > drops the oldest records past the limit" timed out after about 63 s in Fast checks on three unrelated runs: 43376814561 (#3777), 43223493713 and 42982553488.
The test filled the store by calling record()MAX_SEEN + 1 times. Each record() is a durable write of the whole file, so the test made about 500 synced writes of a growing file, and on a loaded runner's disk that took a minute.
The test now writes a full store of MAX_SEEN records to seen.json in one write, opens a SeenStore on it, and then records the one finish that goes past the limit and the update of p1, as before. What it asserts is unchanged: the store keeps MAX_SEEN records and drops the oldest.
Validation
bun test ./server/seen.test.ts passes 18 of 18, three times. The changed test takes 18 to 117 ms, against 5 to 19.5 s on main on this PC.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Tests
Updated test setup for verifying that the oldest record is removed when the storage limit is exceeded.
The seen-store limit test now initializes seen.json with MAX_SEEN finishes, then records one additional finish. The limit and oldest-record checks remain unchanged.
Changes: Seen store limit test
Layer / File(s)
Summary
Initialize records at the limit server/seen.test.ts
The test writes MAX_SEEN finishes to seen.json before recording one additional finish. It retains the existing checks for the limit and oldest-record removal.
This is a test-only change that makes a slow, timeout-prone test fast while still checking that the store keeps its limit and drops the oldest records. It does not change runtime behavior, and no merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change accurately: the test now fills the store in one write before testing its limit. It matches the summary and objectives, which both describe replacing about 500 individual dur…
Description check
The description follows the template's Change and Validation sections. Change explains the timeout, its cause (MAX_SEEN + 1 durable writes of a growing file), and the new behavior. Validation lists th…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the change accurately: the test now fills the store in one write before testing its limit. It matches the summary and objectives, which both describe replacing about 500 individual durable writes with a single write of MAX_SEEN records in server/seen.test.ts.
Full details: Description check
Explanation
The description follows the template's Change and Validation sections. Change explains the timeout, its cause (MAX_SEEN + 1 durable writes of a growing file), and the new behavior. Validation lists the commands run, their results, and why no changelog fragment is needed. The template's CONTRIBUTING.md and changelog reminders are not addressed, and the HTTP/WS contract-test note is not stated, but the change is test-only, so these gaps are minor.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 79420d0 and 83acacf.
Files selected for processing: 1
server/seen.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
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.
Summary
server/seen.test.ts"read finishes shared by the browsers of a server > drops the oldest records past the limit" timed out after about 63 s in Fast checks on three unrelated runs: 43376814561 (#3777), 43223493713 and 42982553488.The test filled the store by calling
record()MAX_SEEN + 1times. Eachrecord()is a durable write of the whole file, so the test made about 500 synced writes of a growing file, and on a loaded runner's disk that took a minute.The test now writes a full store of
MAX_SEENrecords toseen.jsonin one write, opens aSeenStoreon it, and then records the one finish that goes past the limit and the update ofp1, as before. What it asserts is unchanged: the store keepsMAX_SEENrecords and drops the oldest.Validation
bun test ./server/seen.test.tspasses 18 of 18, three times. The changed test takes 18 to 117 ms, against 5 to 19.5 s on main on this PC.bun run check fastpasses, on main 79420d0.