Skip to content

test(files): make SearchBuilderTest independent of shared filecache state#59484

Draft
joshtrichards wants to merge 1 commit intomasterfrom
jtr/test-SearchBuilderTest-flaky-fix
Draft

test(files): make SearchBuilderTest independent of shared filecache state#59484
joshtrichards wants to merge 1 commit intomasterfrom
jtr/test-SearchBuilderTest-flaky-fix

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

  • Resolves: #

Summary

Make SearchBuilderTest less flaky by removing its dependence on a fixed storage id in filecache.

Changes

  • use a unique numericStorageId per test run instead of 10000
  • defensively clean matching filecache rows in setUp()
  • fix addCacheEntry() so storage_mtime is assigned after defaulting mtime

Why

This DB test currently inserts/searches rows in filecache using a hard-coded storage = 10000 and only cleans up in tearDown(). If stale rows exist for that storage, the assertions can pick up unrelated fileids and fail nondeterministically in CI.

Using a unique storage id makes the test self-isolating, and the storage_mtime change fixes a small helper bug where mtime could be read before default initialization.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added bug tests Related to tests labels Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant