Skip to content

Split r2-test's large listings into a faster test of their own - #8854

Merged
danlapid merged 1 commit into
mainfrom
dlapid/r2-test-faster-listings
Nov 25, 2026
Merged

danlapid merged 1 commit into
mainfrom
dlapid/r2-test-faster-listings

Conversation

@danlapid

Copy link
Copy Markdown
Collaborator

r2-test took about 7 s in debug builds, and a slow machine pushed it past its 15 s timeout. Two thirds of that was largeListings: its 300 puts and 300 deletes each make a round trip through r2.js and the bucket service, about 7 ms apiece in a debug build.

  • The two listings use fewer objects, each with metadata near the 8 KiB limit. 70 objects still pass the 512 KiB reply budget, which takes two pages. 50 wide objects with their prefixes still end every page at a prefix (checked by probing page boundaries).
  • The second listing now asserts it takes more than one page. Before, its "bytes, not characters" case relied on the binding refusing a single page of over 1 MiB, and these sizes no longer produce one.
  • The listings move to r2-listing-test, so they run in parallel with the rest of r2-test.

Debug build, 50 runs of each variant on the same remote executors:

p50 p90 timeouts
r2-test before (3 variants) 6.9–7.1 s 11.9–13.3 s 6 of 150
r2-test after 2.4–2.8 s 3.6–4.5 s 0 of 150
r2-listing-test 2.8–3.1 s 3.6–5.2 s 0 of 150

ASan, 50 runs each: r2-test went from a p50 of 3.3 s to 1.3–1.6 s, and r2-listing-test runs at 1.6–1.8 s. All 300 runs passed.

🤖 Generated with Claude Code

r2-test took about 7 s in debug builds, and a slow machine pushed
it past its 15 s timeout. Two thirds of that was largeListings,
whose 300 puts and 300 deletes each cost a round trip through r2.js
and the bucket service.

Its two listings now use fewer objects with metadata near the 8 KiB
limit: 70 objects still pass the 512 KiB reply budget, and 50 wide
objects with their prefixes still end a page at a prefix. The second
listing now asserts it takes more than one page. Before, the
"bytes, not characters" case relied on a single page of over 1 MiB
being refused by the binding, which these sizes no longer reach.

The listings move to r2-listing-test, so they run alongside the rest
of r2-test. In debug builds each test now takes about 2.5-3 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.76%. Comparing base (e622ff5) to head (6242a5c).
⚠️ Report is 61 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8854      +/-   ##
==========================================
- Coverage   67.84%   67.76%   -0.09%     
==========================================
  Files         848      848              
  Lines      215237   216079     +842     
  Branches    32495    32540      +45     
==========================================
+ Hits       146032   146430     +398     
- Misses      50004    50437     +433     
- Partials    19201    19212      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danlapid
danlapid marked this pull request as ready for review November 25, 2026 19:50
@danlapid
danlapid requested review from a team as code owners November 25, 2026 19:50

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — A test-only change that splits the large listings into their own target; the smaller sizes still exceed the 512 KiB reply budget, and the bytes-versus-characters check now asserts more than one page. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

Test-only change. The new config uses a local-disk bucket under TEST_TMPDIR, the same as the existing r2-test config.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

The new test keeps the old assertions and adds an explicit check that the listing takes more than one page. Its sizes still exceed the 512 KiB budget: about 560 KB in the first listing, and about 646 KB in bytes but about 246K in characters in the second.


⚡ Performance: ✅ LGTM

No issues found.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: 6242a5c0

@danlapid
danlapid merged commit e60b09b into main Nov 25, 2026
36 of 37 checks passed
@danlapid
danlapid deleted the dlapid/r2-test-faster-listings branch November 25, 2026 20:04
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.

3 participants