Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix the flaky test provider in LiveBackupTests. - #157

Merged
koculu merged 1 commit into
mainfrom
fix-live-backup-test-race
Jul 9, 2026
Merged

Fix the flaky test provider in LiveBackupTests.#157
koculu merged 1 commit into
mainfrom
fix-live-backup-test-race

Conversation

@koculu

@koculu koculu commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Fixes a flaky live backup unit test by making the test backup provider match the ILiveBackupStore concurrency contract.

What Changed

  • Made CatalogTrackingLiveBackupProvider thread-safe by locking access to its uploaded-file catalog.
  • Changed uploaded-file tracking from SegmentId to FileName, so the fake provider tracks physical segment files the same way the real local backup provider does.
  • Kept the existing assertion semantics: the second generation should ask the provider about existing files but should not upload them again.

Why

LiveBackup may call UseSegmentAsync and UploadSegmentFileAsync concurrently because segment files are copied with Parallel.ForEachAsync. The test provider used a plain HashSet without synchronization, which could race in CI and incorrectly report that previously uploaded files were missing.

@koculu
koculu merged commit 079d324 into main Jul 9, 2026
1 check passed
@koculu
koculu deleted the fix-live-backup-test-race branch July 9, 2026 20:44
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