Skip to content

Commit

Permalink
✅ Fix
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <kyukawa315@gmail.com>
  • Loading branch information
vankichi committed Jan 15, 2025
1 parent bd747ff commit 6141552
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/e2e/crud/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1025,14 +1025,16 @@ func TestE2EAgentRolloutRestart(t *testing.T) {

sleep(t, waitAfterInsertDuration)

searchFunc := func() {
_ = op.Search(t, ctx, operation.Dataset{
searchFunc := func() error {
return op.Search(t, ctx, operation.Dataset{
Test: ds.Test[searchFrom : searchFrom+searchNum],
Neighbors: ds.Neighbors[searchFrom : searchFrom+searchNum],
})
}

wg := sync.WaitGroup{}
mu := sync.Mutex{}
var serr error
wg.Add(1)
done := make(chan struct{})
go func() {
Expand All @@ -1042,7 +1044,16 @@ func TestE2EAgentRolloutRestart(t *testing.T) {
case <-done:
return
default:
searchFunc()
err = searchFunc()
if err != nil {
st, ok := status.FromError(err)
if ok && st.Code() == codes.DeadlineExceeded {
_, _, rerr := status.ParseError(err, codes.DeadlineExceeded, "an error occurred")
mu.Lock()
serr = errors.Join(serr, rerr)
mu.Unlock()
}
}
time.Sleep(10 * time.Second)
}
}
Expand Down Expand Up @@ -1086,4 +1097,7 @@ func TestE2EAgentRolloutRestart(t *testing.T) {
}
close(done)
wg.Wait()
if serr != nil {
t.Fatalf("an error occurred: %s", serr)
}
}

0 comments on commit 6141552

Please sign in to comment.