Skip to content

Commit 253d867

Browse files
authored
test: fix soc flaky test (ethersphere#5382)
1 parent c6357fd commit 253d867

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/api/soc_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ func TestSOC(t *testing.T) {
9595
}),
9696
)
9797

98+
// Wait for the chanStorer drain goroutine to process the chunk and invoke
99+
// the subscriber (which stores it in mockStorer) before issuing GETs.
100+
if err := spinlock.Wait(2*time.Second, func() bool { return chanStore.Has(s.Address()) }); err != nil {
101+
t.Fatal("timed out waiting for chunk to be stored:", err)
102+
}
103+
98104
// try to fetch the same chunk
99105
t.Run("chunks fetch", func(t *testing.T) {
100106
rsrc := fmt.Sprintf("/chunks/%s", s.Address().String())

0 commit comments

Comments
 (0)