Parcourir la source

fix flaky test

Signed-off-by: yisaer <disxiaofei@163.com>
yisaer il y a 2 ans
Parent
commit
43321a711b
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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()