diff --git a/temporalcli/commands.workflow_test.go b/temporalcli/commands.workflow_test.go index 02fddb10f..2c3516743 100644 --- a/temporalcli/commands.workflow_test.go +++ b/temporalcli/commands.workflow_test.go @@ -12,6 +12,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/temporalio/cli/temporalcli" "go.temporal.io/api/enums/v1" "go.temporal.io/api/workflowservice/v1" @@ -505,6 +506,15 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid } }, 30*time.Second, 100*time.Millisecond) + // Wait for all to appear in list + s.Eventually(func() bool { + resp, err := s.Client.ListWorkflow(s.Context, &workflowservice.ListWorkflowExecutionsRequest{ + Query: "CustomKeywordField = '" + searchAttr + "'", + }) + s.NoError(err) + return len(resp.Executions) == len(runs) + }, 3*time.Second, 100*time.Millisecond) + s.CommandHarness.Stdin.WriteString("y\n") res = s.Execute( "workflow", "update-options", @@ -524,15 +534,15 @@ func (s *SharedServerSuite) TestWorkflow_Batch_Update_Options_Versioning_Overrid "-w", run.GetID(), "--output", "json", ) - assert.NoError(t, res.Err) + require.NoError(t, res.Err) var jsonResp workflowservice.DescribeWorkflowExecutionResponse - assert.NoError(t, temporalcli.UnmarshalProtoJSONWithOptions(res.Stdout.Bytes(), &jsonResp, true)) + require.NoError(t, temporalcli.UnmarshalProtoJSONWithOptions(res.Stdout.Bytes(), &jsonResp, true)) versioningInfo := jsonResp.GetWorkflowExecutionInfo().GetVersioningInfo() - assert.NotNil(t, versioningInfo) - assert.NotNil(t, versioningInfo.VersioningOverride) - assert.Equal(t, version2, versioningInfo.VersioningOverride.PinnedVersion) + require.NotNil(t, versioningInfo) + require.NotNil(t, versioningInfo.VersioningOverride) + require.Equal(t, version2, versioningInfo.VersioningOverride.PinnedVersion) } }, 30*time.Second, 100*time.Millisecond) }