Skip to content

test: stop rebuilding folderInfo() across clock ticks in listingCache tests#27

Merged
baronunread merged 1 commit into
mainfrom
fix/flaky-folderinfo-clock
Jul 17, 2026
Merged

test: stop rebuilding folderInfo() across clock ticks in listingCache tests#27
baronunread merged 1 commit into
mainfrom
fix/flaky-folderinfo-clock

Conversation

@baronunread

@baronunread baronunread commented Jul 17, 2026

Copy link
Copy Markdown
Owner

The folderInfo(n) test helper stamps lastModified: Date.now(), so any assertion that compares a cached object against a second, freshly built folderInfo(n) only passes while both calls land in the same millisecond. On a loaded CI runner the clock ticking in between is likely — PR #22's check run just failed exactly there (invalidateConnection test, line 196, a one-line lastModified diff), while the same suite passes locally every time.

Both comparison sites (the inflight-dedupe test and the invalidateConnection test) now build the object once and assert against the same reference.

Third and hopefully last of today's test-flake fixes, after #25 and #26.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Improved coverage for concurrent folder information requests and cache invalidation scenarios.
    • Updated test assertions to use consistent data, reducing timing-related flakiness and making results more reliable.
    • No user-facing functionality or behavior changes are included in this update.

… tests

The helper stamps lastModified with Date.now(), so comparing a cached
object against a second, freshly built folderInfo(n) only passes while
both calls land in the same millisecond. On a loaded CI runner the tick
in between is likely — PR #22's check hit exactly this on the
invalidateConnection test. Both comparison sites now build the object
once and assert against that same reference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 540b6254-1cbf-4730-b447-95e5943ff4f4

📥 Commits

Reviewing files that changed from the base of the PR and between efb02da and c5c6635.

📒 Files selected for processing (1)
  • tests/unit/ui/listingCache.test.ts

📝 Walkthrough

Walkthrough

Updated listing cache unit tests to avoid time-dependent FolderInfo comparisons by reusing shared instances in concurrent request and connection invalidation assertions.

Changes

Listing cache test stability

Layer / File(s) Summary
Stable FolderInfo assertions
tests/unit/ui/listingCache.test.ts
Concurrent deduplication and connection invalidation tests now compare results with explicitly shared FolderInfo instances.
Estimated code review effort: 2 (Simple) ~5 minutes
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the test flakiness fix in listingCache and matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/flaky-folderinfo-clock

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

Comment @coderabbitai help to get the list of available commands.

@baronunread
baronunread merged commit 9d1ecd8 into main Jul 17, 2026
4 checks passed
@baronunread
baronunread deleted the fix/flaky-folderinfo-clock branch July 17, 2026 13:26
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