Remove a race condition from TestRetentionCutoff

This commit is contained in:
beorn7 2016-01-25 16:36:14 +01:00
parent f50d90f3aa
commit 99b9611351
1 changed files with 4 additions and 1 deletions

View File

@ -377,7 +377,10 @@ func TestRetentionCutoff(t *testing.T) {
defer closer.Close() defer closer.Close()
// Stop maintenance loop to prevent actual purging. // Stop maintenance loop to prevent actual purging.
s.loopStopping <- struct{}{} close(s.loopStopping)
<-s.loopStopped
// Recreate channel to avoid panic when we really shut down.
s.loopStopping = make(chan struct{})
s.dropAfter = 1 * time.Hour s.dropAfter = 1 * time.Hour