Skip to content

[Bug] Can't run the tests of UpdateMethod #577

@agpopov

Description

@agpopov

Hello, I want to test UpdateMethod in workflow. But I get an error:

AssertionError: assert($result !== null)
/var/www/html/vendor/temporal/sdk/src/Client/Update/UpdateHandle.php:128
/var/www/html/vendor/temporal/sdk/src/Client/Update/UpdateHandle.php:89
/var/www/html/vendor/temporal/sdk/src/Client/Update/UpdateHandle.php:75
/var/www/html/vendor/temporal/sdk/src/Internal/Client/WorkflowProxy.php:112
/var/www/html/tests/Workflows/UploadFileWorkflowTest.php:83

At the same time, the signal and jquery tests are working fine.

Here is the test code:

public function testCanSaveFileData(): void
    {
        $this->testService->lockTimeSkipping();

        $arguments = [
            'path' => $this->faker()->filePath(),
            'original_name' => $this->faker()->word(),
            'extension' => $this->faker()->fileExtension(),
            'size' => $this->faker()->numberBetween(),
            'is_image' => $this->faker()->boolean(),
        ];

        $file = File::factory()->make($arguments);

        $workflow = $this->workflowClient->newWorkflowStub(UploadFileWorkflow::class);
        $run = $this->workflowClient->start($workflow);

        $this->assertEquals(WorkflowExecutionStatus::Running, $run->describe()->info->status);

        $result = $workflow->saveTempFileData(new SaveFileDataArguments($arguments));

        $this->assertEquals($file->id, $run->describe()->info->searchAttributes->getValue('FileId'));
        $this->assertEquals($file->toArray(), $result['data']);

        $this->testService->unlockTimeSkipping();
    }

I tried calling UpdateMethod via update and startUpdate. the result is exactly the same

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions