Skip to content

Commit

Permalink
core/utils: improve TestThreadControl_GoCtx checks for flake analysis (
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 authored Jul 15, 2024
1 parent 6284e0d commit e825f4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/utils/thread_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -50,7 +51,7 @@ func TestThreadControl_GoCtx(t *testing.T) {
start := time.Now()
wg.Wait()
end := time.Since(start)
require.True(t, end > timeout-1)
require.True(t, end < 2*timeout)
assert.Greater(t, end, timeout-1)
assert.Less(t, end, 2*timeout)
require.Equal(t, int32(1), finished.Load())
}

0 comments on commit e825f4a

Please sign in to comment.