Skip to content

test: fix flaky reserve worker startup#5384

Open
acud wants to merge 2 commits intomasterfrom
fix-reserve-worker-flake
Open

test: fix flaky reserve worker startup#5384
acud wants to merge 2 commits intomasterfrom
fix-reserve-worker-flake

Conversation

@acud
Copy link
Contributor

@acud acud commented Feb 27, 2026

Description

A data race in the reserve worker's startup was created in a way that it may get scheduled after the dependent tests already started. I've added a channel to synchronize this behavior. In node.go I am not using this synchronization as it appears to affect the node startup time in the integration tests.

This fixes the flakes in the TestReserveEvict and the TestReplaceOldIndex tests.

@martinconic
Copy link
Contributor

I have run the CI/CD tests on this PR multiple times, and one time on tests failed that I did not saw before:
https://github.com/ethersphere/bee/actions/runs/22489298892/job/65364049599?pr=5384

Could be because of these changes? can you please check it out?

@acud
Copy link
Contributor Author

acud commented Mar 2, 2026

Checked it out. Can't see how this is related. The goroutine dump in the CI suggest some problem in the CI runner. Note the IO waits etc.

readyC := make(chan struct{})
storer.StartReserveWorker(context.Background(), pullerMock.NewMockRateReporter(0), networkRadiusFunc(1), readyC)
<-readyC
time.Sleep(time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will time.Sleep still be flaky?
Not sure whether synctest can help here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so far i have tried to reproduce any flakiness of these tests locally and even without synctest it passes without a problem

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.

3 participants