diff --git a/integ/.env b/integ/.env index ac50614..eca4ba6 100644 --- a/integ/.env +++ b/integ/.env @@ -3,4 +3,5 @@ ELASTICSEARCH_VERSION=7.16.2 MYSQL_VERSION=8 POSTGRESQL_VERSION=13 TEMPORAL_VERSION=1.25 +TEMPORAL_ADMIN_TOOLS_VERSION=1.25.2-tctl-1.18.1-cli-1.1.1 TEMPORAL_UI_VERSION=2.31.2 \ No newline at end of file diff --git a/integ/docker-compose.yml b/integ/docker-compose.yml index 8430f95..7eda69c 100644 --- a/integ/docker-compose.yml +++ b/integ/docker-compose.yml @@ -58,7 +58,7 @@ services: environment: - TEMPORAL_ADDRESS=temporal:7233 - TEMPORAL_CLI_ADDRESS=temporal:7233 - image: temporalio/admin-tools:${TEMPORAL_VERSION} + image: temporalio/admin-tools:${TEMPORAL_ADMIN_TOOLS_VERSION} networks: - temporal-network stdin_open: true diff --git a/integ/rpc_test.go b/integ/rpc_test.go index ba52189..314f2ed 100644 --- a/integ/rpc_test.go +++ b/integ/rpc_test.go @@ -30,6 +30,11 @@ func TestRPCWorkflow(t *testing.T) { rpcErr, _ := err.(*iwf.ApiError) assert.Equal(t, "worker API error, status:501, errorType:test-error-type", rpcErr.Response.GetDetail()) + // Test unregister client + unregClient := iwf.NewUnregisteredClient(nil) + err = unregClient.InvokeRPCByName(context.Background(), wfId, "", "TestErrorRPC", 1, nil, nil) + assert.NotNil(t, err) + var rpcOutput int err = client.InvokeRPC(context.Background(), wfId, "", wf.TestRPC, 1, &rpcOutput) assert.Nil(t, err) diff --git a/integ/workflow_uncompleted_test.go b/integ/workflow_uncompleted_test.go index d1a94e7..836cc0d 100644 --- a/integ/workflow_uncompleted_test.go +++ b/integ/workflow_uncompleted_test.go @@ -112,8 +112,8 @@ func TestStateApiTimeoutWorkflow(t *testing.T) { fmt.Println(err) - expectedMsg := "workflow is not completed successfully, closedStatus: FAILED, failedErrorType(applies if failed as closedStatus):STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE, error message:activity error (type: StateApiWaitUntil, scheduledEventID: 8, startedEventID: 9, identity: ): activity StartToClose timeout (type: StartToClose)" - assert.Equal(t, expectedMsg, err.Error()) + expectedMsg := "workflow is not completed successfully, closedStatus: FAILED, failedErrorType(applies if failed as closedStatus):STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE, error message:activity error " + assert.True(t, strings.HasPrefix(err.Error(), expectedMsg)) out, err2 := client.GetComplexWorkflowResults(context.Background(), wfId, "") assert.Nil(t, out) diff --git a/iwf/errors.go b/iwf/errors.go index e201ae8..489e8c7 100644 --- a/iwf/errors.go +++ b/iwf/errors.go @@ -171,7 +171,7 @@ func IsWorkflowNotExistsError(err error) bool { func IsRPCError(err error) bool { apiError, ok := err.(*ApiError) - if !ok || apiError.Response == nil { + if !ok { return false } return apiError.StatusCode == 420