Skip to content

Commit 5371970

Browse files
authored
Unblock using conflict policy UseExisting for Nexus WorkflowRunOperation (#1858)
1 parent 884681f commit 5371970

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

internal/cmd/build/main.go

-4
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ func (b *builder) integrationTest() error {
140140
// Start dev server if wanted
141141
if *devServerFlag {
142142
devServer, err := testsuite.StartDevServer(context.Background(), testsuite.DevServerOptions{
143-
// TODO: Use stable release once server 1.27.0 is out.
144-
CachedDownload: testsuite.CachedDownload{
145-
Version: "v1.3.0-rc.0",
146-
},
147143
ClientOptions: &client.Options{
148144
HostPort: "127.0.0.1:7233",
149145
Namespace: "integration-test-namespace",

temporalnexus/operation.go

-9
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,6 @@ func ExecuteUntypedWorkflow[R any](
389389
internal.SetLinksOnStartWorkflowOptions(&startWorkflowOptions, links)
390390
internal.SetOnConflictOptionsOnStartWorkflowOptions(&startWorkflowOptions)
391391

392-
// TODO(rodrigozhou): temporarily blocking conflict policy UseExisting.
393-
if startWorkflowOptions.WorkflowIDConflictPolicy == enums.WORKFLOW_ID_CONFLICT_POLICY_USE_EXISTING {
394-
return nil, &nexus.HandlerError{
395-
Type: nexus.HandlerErrorTypeInternal,
396-
RetryBehavior: nexus.HandlerErrorRetryBehaviorNonRetryable,
397-
Cause: errors.New("workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation"),
398-
}
399-
}
400-
401392
// This makes sure that ExecuteWorkflow will respect the WorkflowIDConflictPolicy, ie., if the
402393
// conflict policy is to fail (default value), then ExecuteWorkflow will return an error if the
403394
// workflow already running. For Nexus, this ensures that operation has only started successfully

test/nexus_test.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -1131,11 +1131,9 @@ func TestAsyncOperationFromWorkflow_MultipleCallers(t *testing.T) {
11311131
{
11321132
input: "conflict-policy-use-existing",
11331133
checkOutput: func(t *testing.T, numCalls int, res CallerWfOutput, err error) {
1134-
// TODO(rodrigozhou): assert NotError and remove the comments below after UseExisting is
1135-
// unblocked.
1136-
require.ErrorContains(t, err, "workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation")
1137-
// require.EqualValues(t, numCalls, res.CntOk)
1138-
// require.EqualValues(t, 0, res.CntErr)
1134+
require.NoError(t, err)
1135+
require.EqualValues(t, numCalls, res.CntOk)
1136+
require.EqualValues(t, 0, res.CntErr)
11391137
},
11401138
},
11411139
}
@@ -1828,11 +1826,9 @@ func TestWorkflowTestSuite_WorkflowRunOperation_MultipleCallers(t *testing.T) {
18281826
{
18291827
input: "conflict-policy-use-existing",
18301828
checkOutput: func(t *testing.T, numCalls int, res CallerWfOutput, err error) {
1831-
// TODO(rodrigozhou): assert NotError and remove the comments below after UseExisting is
1832-
// unblocked.
1833-
require.ErrorContains(t, err, "workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation")
1834-
// require.EqualValues(t, numCalls, res.CntOk)
1835-
// require.EqualValues(t, 0, res.CntErr)
1829+
require.NoError(t, err)
1830+
require.EqualValues(t, numCalls, res.CntOk)
1831+
require.EqualValues(t, 0, res.CntErr)
18361832
},
18371833
},
18381834
}

0 commit comments

Comments
 (0)