From 0b431366ed670acbecca0feb025dd93567e9c98f Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Mon, 16 Dec 2024 15:44:07 +0400 Subject: [PATCH] Fix DeduplicationTest to be compatible with temporal 1.2.0 --- tests/Acceptance/Harness/Update/DeduplicationTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Acceptance/Harness/Update/DeduplicationTest.php b/tests/Acceptance/Harness/Update/DeduplicationTest.php index c4bccf64..bc65d174 100644 --- a/tests/Acceptance/Harness/Update/DeduplicationTest.php +++ b/tests/Acceptance/Harness/Update/DeduplicationTest.php @@ -9,6 +9,7 @@ use Temporal\Client\Update\UpdateOptions; use Temporal\Client\WorkflowClientInterface; use Temporal\Client\WorkflowStubInterface; +use Temporal\Exception\Client\WorkflowUpdateException; use Temporal\Tests\Acceptance\App\Attribute\Stub; use Temporal\Tests\Acceptance\App\TestCase; use Temporal\Workflow; @@ -39,8 +40,13 @@ public function check( self::assertSame(1, $handle1->getResult(1)); self::assertSame(1, $handle2->getResult(1)); - # This only needs to start to unblock the workflow - $stub->startUpdate('my_update'); + try { + # This only needs to start to unblock the workflow + $stub->startUpdate('my_update'); + } catch (WorkflowUpdateException) { + # Workflow Update failed because the Workflow completed before the Update completed + # It's OK in this case + } # There should be two accepted updates, and only one of them should be completed with the set id $totalUpdates = 0;