Skip to content

api tests: wait for the background work two tests race under load - #113

Merged
Omar-VF merged 2 commits into
Liquid-co:dev-publicfrom
ChakraFusion:pr/age-sweep-test
Oct 23, 2026
Merged

Omar-VF merged 2 commits into
Liquid-co:dev-publicfrom
ChakraFusion:pr/age-sweep-test

Conversation

@ChakraFusion

Copy link
Copy Markdown

Two internal/api tests failed on my slower machine under load. Both have a cause in the test, not the app:

  • TestSettings_AutoDeleteOldSnapshots_SweepsWhenSwitchedOn waited until the old snapshot's row was gone, then looked once for its archive. The sweep (PruneOlderThan) deletes the rows first and drops the archives only after its last row, so the archive could still be there ("the deleted snapshot's archive is still on disk"). It now waits for the archive too. With a 300 ms pause put before the archives are dropped, the old test fails 3 of 3 and the new one passes. This is the test I mentioned in Fixes and improvements from running 2.4.1 on 4 PCs with large saves — how would you like them? #21 as failing intermittently under load since v2.4.1.
  • TestSaveFiles_MissingLocationDoesNotBreakTheListing adds a save location, which starts its watch and first read in the background (RewatchGame), then removes the folder straight away. On Windows that failed with "The process cannot access the file because it is being used by another process". It now retries the removal for up to five seconds, as testutil.RemoveTree does for the same race in the e2e tests.

Checks: the full unit and e2e suites pass locally on today's dev-public.

🤖 Generated with Claude Code

ChakraFusion and others added 2 commits October 20, 2026 21:52
…he row

TestSettings_AutoDeleteOldSnapshots_SweepsWhenSwitchedOn waited until the
old snapshot's row was gone, then looked once for its archive. The sweep
(PruneOlderThan) deletes the rows first and the archives only after its
last row, so under load the archive was still there: "the deleted
snapshot's archive is still on disk". With a 300 ms pause put before the
archives are dropped, the old test fails 3/3 and this one passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adding a save location starts its watch and first read in the background
(RewatchGame). The test removed the folder straight away, and on Windows
under load that failed: "The process cannot access the file because it
is being used by another process" - the test racing the app, as
testutil.RemoveTree says of the same race in the e2e tests. Retried for up
to five seconds.

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

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Omar-VF
Omar-VF merged commit a13db79 into Liquid-co:dev-public Oct 23, 2026
10 of 11 checks passed
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.

2 participants