Skip to content

Commit

Permalink
make termination test more predictable
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 7, 2024
1 parent f7944bc commit 89c2610
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion errsizedgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ func TestErrorSizedGroup_TermOnErr(t *testing.T) {
}

err := ewg.Wait()
t.Logf("error: %v", err)

require.NotNil(t, err)
require.Contains(t, err.Error(), "err from function 100")
assert.Contains(t, err.Error(), "err from function ")
// we don't know how many routines will be executed before the error, but it should be less than 10
require.LessOrEqual(t, c, uint32(errIndex+100), fmt.Sprintf("%d, routines have to be terminated early", c))
}
Expand Down

0 comments on commit 89c2610

Please sign in to comment.