Skip to content

Commit

Permalink
add eventually method && a bit refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
korableg committed Dec 23, 2024
1 parent 090ba76 commit 60d4165
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/framework/asserts_wrapper/wrapper/wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3681,12 +3681,12 @@ func TestAssertsEventually_Success(t *testing.T) {
mockT := newMock()

var (
counter atomic.Int32
counter int32
waitFor = time.Second
tick = 10 * time.Millisecond
)
NewAsserts(mockT).Eventually(mockT, func() bool {
if counter.Add(1) < 3 {
if atomic.AddInt32(&counter, 1) < 3 {
time.Sleep(20 * time.Millisecond)
return false
}
Expand Down Expand Up @@ -3715,12 +3715,12 @@ func TestAssertsEventually_Fail(t *testing.T) {
mockT := newMock()

var (
counter atomic.Int32
counter int32
waitFor = 10 * time.Millisecond
tick = 10 * time.Millisecond
)
NewAsserts(mockT).Eventually(mockT, func() bool {
if counter.Add(1) < 3 {
if atomic.AddInt32(&counter, 1) < 3 {
time.Sleep(20 * time.Millisecond)
return false
}
Expand Down Expand Up @@ -3749,12 +3749,12 @@ func TestRequireEventually_Success(t *testing.T) {
mockT := newMock()

var (
counter atomic.Int32
counter int32
waitFor = time.Second
tick = 10 * time.Millisecond
)
NewRequire(mockT).Eventually(mockT, func() bool {
if counter.Add(1) < 3 {
if atomic.AddInt32(&counter, 1) < 3 {
time.Sleep(20 * time.Millisecond)
return false
}
Expand Down Expand Up @@ -3783,12 +3783,12 @@ func TestRequireEventually_Fail(t *testing.T) {
mockT := newMock()

var (
counter atomic.Int32
counter int32
waitFor = 10 * time.Millisecond
tick = 10 * time.Millisecond
)
NewRequire(mockT).Eventually(mockT, func() bool {
if counter.Add(1) < 3 {
if atomic.AddInt32(&counter, 1) < 3 {
time.Sleep(20 * time.Millisecond)
return false
}
Expand Down

0 comments on commit 60d4165

Please sign in to comment.