Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
kutluhanmetin committed Nov 2, 2023
1 parent 249dd3d commit 7705c54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions base/commands/migration/cancel_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand Down
5 changes: 2 additions & 3 deletions base/commands/migration/status_stages_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"sync"
"testing"
"time"

_ "github.com/hazelcast/hazelcast-commandline-client/base"
_ "github.com/hazelcast/hazelcast-commandline-client/base/commands"
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 7705c54

Please sign in to comment.