Skip to content

[Bug] upsertTypedSearchAttributes in test server #654

@Norbytus

Description

@Norbytus

What are you really trying to do?

Trying upsert search attribute inside workflow

Describe the bug

Create workflow with and call Workflow::upsertTypedSearchAttributes inside workflow

Minimal Reproduction

For example i take test from https://github.com/wolfy-j/temporal-simple-test-example

<?php

declare(strict_types=1);

namespace App\Workflow;

use App\Activity\GreetingActivityInterface;
use App\Activity\VoidActivityInterface;
use Carbon\CarbonInterval;
use Temporal\Activity\ActivityOptions;
use Temporal\Common\SearchAttributes\SearchAttributeKey;
use Temporal\Workflow;

class GreetingWorkflow implements GreetingWorkflowInterface
{
    private $greetingActivity;

    public function __construct()
    {
        /**
         * Activity stub implements activity interface and proxies calls to it to Temporal activity
         * invocations. Because activities are reentrant, only a single stub can be used for multiple
         * activity invocations.
         */
        $this->greetingActivity = Workflow::newActivityStub(
            GreetingActivityInterface::class,
            ActivityOptions::new()
                ->withStartToCloseTimeout(CarbonInterval::seconds(2))
                ->withTaskQueue('tests'),
        );

        $this->voidActivity = Workflow::newActivityStub(
            VoidActivityInterface::class,
            ActivityOptions::new()
                ->withStartToCloseTimeout(CarbonInterval::seconds(2))
                ->withTaskQueue('tests'),
        );
    }

    public function greet(string $name): \Generator
    {
        Workflow::upsertTypedSearchAttributes(
            SearchAttributeKey::forKeyword('CustomKeyword')->valueSet('CustomValue'),
        );

        return yield $this->greetingActivity->composeGreeting('Hello', $name);
    }
}

And run phpunit and test will failed with timeout

Metadata

Metadata

Assignees

No one assigned

    Labels

    TestsUpdate tests or testing tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions