bee
bee copied to clipboard
test(puller): fix race condition in TestSyncIntervals
Checklist
- [ ] I have read the coding guide.
- [ ] My change requires a documentation update, and I have done it.
- [ ] I have added tests to cover my changes.
- [ ] I have filled out the description and linked the related issues.
Description
Wait for interval persistence using spinlock.Wait() instead of fixed sleep. This fixes the flaky 'storage: not found' error in TestSyncIntervals/0,50-_2_calls by polling for the interval to appear in storage rather than checking immediately after sync operations complete.
The test was failing because checkIntervals() was checking for persisted intervals immediately after sync calls completed, but interval persistence happens asynchronously. Using spinlock.Wait() makes the test more deterministic and handles timing variations better than a fixed time.Sleep().