瀏覽代碼

Merge pull request #6168 from heyitsanthony/fix-periodic-test-block

compactor: wait for After() in TestPeriodic
Anthony Romano 9 年之前
父節點
當前提交
817de6d212
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      compactor/compactor_test.go

+ 4 - 1
compactor/compactor_test.go

@@ -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 {