Yeuoly 1 年之前
父節點
當前提交
21d930b4b7
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      internal/cluster/clutser_test.go

+ 3 - 1
internal/cluster/clutser_test.go

@@ -43,6 +43,9 @@ func TestSingleClusterLifetime(t *testing.T) {
 	}
 	clusters[0].Launch()
 	defer func() {
+		clusters[0].Close()
+		// wait for the cluster to close
+		time.Sleep(time.Second * 1)
 		// check if the cluster is closed
 		_, err := cache.GetMapField[node](CLUSTER_STATUS_HASH_MAP_KEY, clusters[0].id)
 		if err == nil {
@@ -50,7 +53,6 @@ func TestSingleClusterLifetime(t *testing.T) {
 			return
 		}
 	}()
-	defer clusters[0].Close()
 
 	time.Sleep(time.Second * 1)