Skip to content

Commit

Permalink
Fix dangling tests on timer
Browse files Browse the repository at this point in the history
  • Loading branch information
mengdaming committed Feb 18, 2022
1 parent 7786109 commit 5cae9e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tcr-engine/timer/periodic_reminder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func TestMain(m *testing.M) {
testTickPeriod = 40 * time.Millisecond
} else {
fmt.Println("Running tests with long timers")
testTimeout = 2000 * time.Millisecond
testTickPeriod = 800 * time.Millisecond
testTimeout = 3000 * time.Millisecond
testTickPeriod = 1200 * time.Millisecond
}
// Run tests
exitVal := m.Run()
Expand Down Expand Up @@ -187,7 +187,9 @@ func Test_callback_function_can_know_timestamp(t *testing.T) {
case StartEvent:
tsStart = ctx.timestamp
case PeriodicEvent:
tsPeriodic[ctx.index] = ctx.timestamp
if ctx.index < 2 {
tsPeriodic[ctx.index] = ctx.timestamp
}
case TimeoutEvent:
tsTimeout = ctx.timestamp
}
Expand Down

0 comments on commit 5cae9e7

Please sign in to comment.