From 7705c5406c9a705f874c5df1a612c8337604c7bf Mon Sep 17 00:00:00 2001 From: kmetin Date: Thu, 2 Nov 2023 23:27:48 +0300 Subject: [PATCH] try --- base/commands/migration/cancel_it_test.go | 7 ++----- base/commands/migration/status_stages_it_test.go | 5 ++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/base/commands/migration/cancel_it_test.go b/base/commands/migration/cancel_it_test.go index 25bb6bb1..f26e8ac4 100644 --- a/base/commands/migration/cancel_it_test.go +++ b/base/commands/migration/cancel_it_test.go @@ -7,13 +7,13 @@ import ( "os" "sync" "testing" + "time" _ "github.com/hazelcast/hazelcast-commandline-client/base" _ "github.com/hazelcast/hazelcast-commandline-client/base/commands" "github.com/hazelcast/hazelcast-commandline-client/base/commands/migration" . "github.com/hazelcast/hazelcast-commandline-client/internal/check" "github.com/hazelcast/hazelcast-commandline-client/internal/it" - hz "github.com/hazelcast/hazelcast-go-client" "github.com/hazelcast/hazelcast-go-client/serialization" "github.com/stretchr/testify/require" ) @@ -46,7 +46,6 @@ func cancelTest(t *testing.T) { ctx := context.Background() tcx.Tester(func(tcx it.TestContext) { mID := migrationIDFunc() - ci := hz.NewClientInternal(tcx.Client) createMapping(ctx, tcx) setStatusInProgress(tcx, ctx) var wg sync.WaitGroup @@ -55,9 +54,7 @@ func cancelTest(t *testing.T) { defer wg.Done() Must(tcx.CLC().Execute(ctx, "cancel")) }) - it.Eventually(t, func() bool { - return migration.WaitForMigrationToBeInProgress(ctx, ci, mID) == nil - }) + time.Sleep(1 * time.Second) setStatusCancelling(mID, tcx, ctx) wg.Wait() statusMap := MustValue(tcx.Client.GetMap(ctx, migration.StatusMapName)) diff --git a/base/commands/migration/status_stages_it_test.go b/base/commands/migration/status_stages_it_test.go index 4776c43e..074771b0 100644 --- a/base/commands/migration/status_stages_it_test.go +++ b/base/commands/migration/status_stages_it_test.go @@ -8,6 +8,7 @@ import ( "os" "sync" "testing" + "time" _ "github.com/hazelcast/hazelcast-commandline-client/base" _ "github.com/hazelcast/hazelcast-commandline-client/base/commands" @@ -66,9 +67,7 @@ func statusTest(t *testing.T) { defer wg.Done() Must(tcx.CLC().Execute(ctx, "status", "-o", outDir)) }) - it.Eventually(t, func() bool { - return migration.WaitForMigrationToBeInProgress(ctx, ci, mID) == nil - }) + time.Sleep(1 * time.Second) setStatusCompleted(mID, tcx, ctx) wg.Wait() tcx.AssertStdoutContains("Connected to the migration cluster")