Skip to content

Commit

Permalink
Fix DeduplicationTest to be compatible with temporal 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Dec 17, 2024
1 parent 3fb450b commit 0b43136
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Acceptance/Harness/Update/DeduplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0b43136

Please sign in to comment.