diff --git a/tests/Acceptance/Extra/Update/UpdateWithStartTest.php b/tests/Acceptance/Extra/Update/UpdateWithStartTest.php index a72fbd2c..f29a5e63 100644 --- a/tests/Acceptance/Extra/Update/UpdateWithStartTest.php +++ b/tests/Acceptance/Extra/Update/UpdateWithStartTest.php @@ -58,7 +58,7 @@ public function failWithBadUpdateName( $this->assertStringContainsString('await1234', $e->getPrevious()->getMessage()); } finally { try { - $stub->getResult(timeout: 1); + $stub->getResult(); $this->fail('Workflow must fail'); } catch (WorkflowFailedException) { $this->assertTrue(true); diff --git a/tests/Acceptance/Extra/Workflow/AllHandlersFinishedTest.php b/tests/Acceptance/Extra/Workflow/AllHandlersFinishedTest.php index f3f5ead7..9db4af96 100644 --- a/tests/Acceptance/Extra/Workflow/AllHandlersFinishedTest.php +++ b/tests/Acceptance/Extra/Workflow/AllHandlersFinishedTest.php @@ -29,7 +29,7 @@ public function updateHandlersWithOneCall( $resolver = $stub->startUpdate('resolve', "key", "resolved"); // Should be completed after the previous operation - $result = $stub->getResult(timeout: 1); + $result = $stub->getResult(); $this->assertSame(['key' => 'resolved'], (array) $result, 'Workflow result contains resolved value'); $this->assertFalse($handle->hasResult()); @@ -58,7 +58,7 @@ public function updateHandlersWithManyCalls( } // Should be completed after the previous operation - $result = $stub->getResult(timeout: 1); + $result = $stub->getResult(); $this->assertSame( [ @@ -87,7 +87,7 @@ public function signalHandlersWithOneCall( /** @see TestWorkflow::resolveFromSignal() */ $stub->signal('resolve', "key", "resolved"); - $result = $stub->getResult(timeout: 1); + $result = $stub->getResult(); $this->assertSame(['key' => 'resolved'], (array) $result, 'Workflow result contains resolved value'); } @@ -106,7 +106,7 @@ public function signalHandlersWithManyCalls( $stub->signal('resolve', "key-$i", "resolved-$i"); } - $result = $stub->getResult(timeout: 1); + $result = $stub->getResult(); $this->assertSame( [ @@ -153,7 +153,7 @@ public function warnUnfinishedSignals( // Finish the workflow $stub->signal('exit'); - $stub->getResult(timeout: 1); + $stub->getResult(); // todo Check that `await` signal with count was mentioned in the logs } @@ -173,7 +173,7 @@ public function warnUnfinishedUpdates( // Finish the workflow $stub->signal('exit'); - $stub->getResult(timeout: 1); + $stub->getResult(); // todo Check that `await` updates was mentioned in the logs } @@ -194,7 +194,7 @@ public function warnUnfinishedOnCancel( $stub->cancel(); try { - $stub->getResult(timeout: 1); + $stub->getResult(); $this->fail('Cancellation exception must be thrown'); } catch (WorkflowFailedException) { // Expected diff --git a/tests/Acceptance/Harness/Update/DeduplicationTest.php b/tests/Acceptance/Harness/Update/DeduplicationTest.php index bc65d174..4b6ebb17 100644 --- a/tests/Acceptance/Harness/Update/DeduplicationTest.php +++ b/tests/Acceptance/Harness/Update/DeduplicationTest.php @@ -9,7 +9,6 @@ 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; @@ -40,13 +39,8 @@ public function check( self::assertSame(1, $handle1->getResult(1)); self::assertSame(1, $handle2->getResult(1)); - 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 - } + # This only needs to start to unblock the workflow + $stub->startUpdate('my_update'); # There should be two accepted updates, and only one of them should be completed with the set id $totalUpdates = 0; @@ -70,7 +64,7 @@ class FeatureWorkflow #[WorkflowMethod('Harness_Update_Deduplication')] public function run() { - yield Workflow::await(fn(): bool => $this->counter >= 2); + yield Workflow::await(fn(): bool => $this->counter >= 2 && Workflow::allHandlersFinished()); return $this->counter; }