@@ -3471,6 +3471,35 @@ func (ts *IntegrationTestSuite) TestUpdateRejected() {
3471
3471
ts .NoError (run .Get (ctx , nil ))
3472
3472
}
3473
3473
3474
+ func (ts * IntegrationTestSuite ) TestUpdateRejectedDuplicated () {
3475
+ ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
3476
+ defer cancel ()
3477
+ options := ts .startWorkflowOptions ("test-update-rejected-duplicated" )
3478
+ run , err := ts .client .ExecuteWorkflow (ctx , options , ts .workflows .WorkflowWithRejectableUpdate )
3479
+ ts .NoError (err )
3480
+ // Send an update we expect to be rejected before the first workflow task
3481
+ handle , err := ts .client .UpdateWorkflow (ctx , client.UpdateWorkflowOptions {
3482
+ WorkflowID : run .GetID (),
3483
+ RunID : run .GetRunID (),
3484
+ UpdateName : "update" ,
3485
+ WaitForStage : client .WorkflowUpdateStageCompleted ,
3486
+ Args : []interface {}{true },
3487
+ })
3488
+ ts .NoError (err )
3489
+ ts .Error (handle .Get (ctx , nil ))
3490
+ // Same update ID should be allowed to be reused after the first attempt is rejected
3491
+ handle , err = ts .client .UpdateWorkflow (ctx , client.UpdateWorkflowOptions {
3492
+ WorkflowID : run .GetID (),
3493
+ RunID : run .GetRunID (),
3494
+ UpdateName : "update" ,
3495
+ WaitForStage : client .WorkflowUpdateStageCompleted ,
3496
+ Args : []interface {}{false },
3497
+ })
3498
+ ts .NoError (err )
3499
+ ts .NoError (handle .Get (ctx , nil ))
3500
+ ts .client .CancelWorkflow (ctx , run .GetID (), run .GetRunID ())
3501
+ }
3502
+
3474
3503
func (ts * IntegrationTestSuite ) TestUpdateSettingHandlerInGoroutine () {
3475
3504
ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
3476
3505
defer cancel ()
0 commit comments