Skip to content

Fix ContinueAsNew dropping memo and search attributes in test server#2870

Open
baekgyu-kim wants to merge 1 commit intotemporalio:masterfrom
baekgyu-kim:2655
Open

Fix ContinueAsNew dropping memo and search attributes in test server#2870
baekgyu-kim wants to merge 1 commit intotemporalio:masterfrom
baekgyu-kim:2655

Conversation

@baekgyu-kim
Copy link
Copy Markdown

What was changed

Fixed the in-memory test server losing memo and search attributes across ContinueAsNew. The continued run now inherits both from the previous run by default, while still honoring explicit overrides, including explicit empty memo, and reflecting in-flight upsertMemo / upsertTypedSearchAttributes mutations.

Specifically:

  • StateMachines now populates memo and search attributes on the WorkflowExecutionContinuedAsNew event, falling back to the live workflow state when the command omits the field.
  • TestWorkflowService now copies memo from the WorkflowExecutionContinuedAsNew event onto the new run's start request. The search attributes path was already wired.

Why?

The in-memory test server's behavior diverged from the real Temporal service for ContinueAsNew runs that rely on inherited memo or search attributes. This made the test server unreliable for verifying memo/search-attribute-dependent workflow logic.

Checklist

  1. Closes Testing server continue-as-new doesn't carry memo/search attributes #2655.

  2. How was this tested:

  • Added six regression tests in ContinueAsNewTest covering inherit, override, upsert-then-inherit for memo and search attributes, upsert-null memo removal, and explicit empty memo override.
./gradlew :temporal-test-server:test --tests io.temporal.testserver.functional.ContinueAsNewTest
  1. Any docs updates needed?
    No. This is an internal test server behavior fix that aligns it with the real Temporal service; no public API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Testing server continue-as-new doesn't carry memo/search attributes

1 participant