Skip to content

test(seen): fill the store in one write before testing its limit - #3830

Merged
devswha merged 1 commit into
mainfrom
test/seen-limit-one-write
Nov 15, 2026
Merged

devswha merged 1 commit into
mainfrom
test/seen-limit-one-write

Conversation

@devswha

@devswha devswha commented Nov 14, 2026

Copy link
Copy Markdown
Owner

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 + 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.
  • bun run check fast passes, on main 79420d0.
  • No changelog fragment, because the change is test-only.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

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.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: Minimal · up to 83aca

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

Commits

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.

@devswha
devswha merged commit 17eb696 into main Nov 15, 2026
21 checks passed
@devswha

devswha commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 83acacfd4a7b as 17eb6964ae77 on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
codex CLEAR

One reviewer: test-only.

No findings left open.
Review reports: ~/.cache/ovis-tmp/reports/

@devswha
devswha deleted the test/seen-limit-one-write branch November 15, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant