Commit c3f9dc19 authored by acud's avatar acud Committed by GitHub

fix(retrieval): flaky test (#2345)

parent d7b48d90
......@@ -513,10 +513,18 @@ func TestRetrievePreemptiveRetry(t *testing.T) {
if !bytes.Equal(got.Data(), chunk.Data()) {
t.Fatalf("got data %x, want %x", got.Data(), chunk.Data())
}
if got, _ := serverStorer1.Has(context.Background(), chunk.Address()); !got {
has := false
for i := 0; i < 10; i++ {
has, _ = serverStorer1.Has(context.Background(), chunk.Address())
if has {
break
}
time.Sleep(100 * time.Millisecond)
}
if !has {
t.Fatalf("forwarder node does not have chunk")
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment