浏览代码

fix flaky test

Signed-off-by: yisaer <disxiaofei@163.com>
yisaer 2 年之前
父节点
当前提交
43321a711b
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      internal/topo/node/cache/sync_cache_test.go

+ 3 - 1
internal/topo/node/cache/sync_cache_test.go

@@ -1,4 +1,4 @@
-// Copyright 2022 EMQ Technologies Co., Ltd.
+// Copyright 2022-2023 EMQ Technologies Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -212,6 +212,8 @@ func TestRun(t *testing.T) {
 			time.Sleep(1 * time.Millisecond)
 		}
 		cancel()
+		// wait cleanup job done
+		time.Sleep(1 * time.Second)
 
 		// send the second half data
 		ctx, cancel = context.WithValue(context.Background(), context.LoggerKey, contextLogger).WithMeta(fmt.Sprintf("rule%d", i), fmt.Sprintf("op%d", i), tempStore).WithCancel()