Skip to content

Commit

Permalink
compactor: wait for After() in TestPeriodic
Browse files Browse the repository at this point in the history
If the test calls clock.Advance() after the compactor checks clock.Now()
but before the compactor calls clock.After(), the compactor will wait
forever on clock.After() expecting the lost clock.Advance().

Reproduced failure by putting a Sleep() in the clock.Now() continue path.

Fixes #6060 (again)
  • Loading branch information
heyitsanthony committed Aug 12, 2016
1 parent 67b1c7c commit 5eff6fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compactor/compactor_test.go
Expand Up @@ -47,7 +47,10 @@ func TestPeriodic(t *testing.T) {
fc.Advance(checkCompactionInterval)
rg.Wait(1)
}
// ready to acknowledge hour "i"; unblock clock
// ready to acknowledge hour "i"
// block until compactor calls clock.After()
fc.BlockUntil(1)
// unblock the After()
fc.Advance(checkCompactionInterval)
a, err := compactable.Wait(1)
if err != nil {
Expand Down

0 comments on commit 5eff6fb

Please sign in to comment.