Skip to content

Commit e6f4d22

Browse files
rodrigozhouQuinn-With-Two-Ns
authored andcommitted
Unblock using conflict policy UseExisting for Nexus WorkflowRunOperation (#1858)
1 parent a85ce60 commit e6f4d22

File tree

3 files changed

+6
-23
lines changed

3 files changed

+6
-23
lines changed

internal/cmd/build/main.go

Lines changed: 0 additions & 4 deletions
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

Lines changed: 0 additions & 9 deletions
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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,11 +1082,9 @@ func TestAsyncOperationFromWorkflow_MultipleCallers(t *testing.T) {
10821082
{
10831083
input: "conflict-policy-use-existing",
10841084
checkOutput: func(t *testing.T, numCalls int, res CallerWfOutput, err error) {
1085-
// TODO(rodrigozhou): assert NotError and remove the comments below after UseExisting is
1086-
// unblocked.
1087-
require.ErrorContains(t, err, "workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation")
1088-
// require.EqualValues(t, numCalls, res.CntOk)
1089-
// require.EqualValues(t, 0, res.CntErr)
1085+
require.NoError(t, err)
1086+
require.EqualValues(t, numCalls, res.CntOk)
1087+
require.EqualValues(t, 0, res.CntErr)
10901088
},
10911089
},
10921090
}
@@ -1779,11 +1777,9 @@ func TestWorkflowTestSuite_WorkflowRunOperation_MultipleCallers(t *testing.T) {
17791777
{
17801778
input: "conflict-policy-use-existing",
17811779
checkOutput: func(t *testing.T, numCalls int, res CallerWfOutput, err error) {
1782-
// TODO(rodrigozhou): assert NotError and remove the comments below after UseExisting is
1783-
// unblocked.
1784-
require.ErrorContains(t, err, "workflow ID conflict policy UseExisting is not supported for Nexus WorkflowRunOperation")
1785-
// require.EqualValues(t, numCalls, res.CntOk)
1786-
// require.EqualValues(t, 0, res.CntErr)
1780+
require.NoError(t, err)
1781+
require.EqualValues(t, numCalls, res.CntOk)
1782+
require.EqualValues(t, 0, res.CntErr)
17871783
},
17881784
},
17891785
}

0 commit comments

Comments
 (0)