Add ContinueAsNew search attribute tests for test server#2870
Add ContinueAsNew search attribute tests for test server#2870baekgyu-kim wants to merge 1 commit into
Conversation
maciejdudko
left a comment
There was a problem hiding this comment.
Hi @baekgyu-kim, thank you for your contribution. Unfortunately there was a mistake in the referenced issue - the real server only preserves Search Attributes on Continue-as-New; Memos are cleared. Which means the PR in its current form does not match the real server behavior. Please remove the changes to Memo handling and only keep the changes to Search Attributes handling. Make sure all tests pass both when run on test server and on real server. You can make the tests use a local dev server by setting environment variables USE_DOCKER_SERVICE=true and USE_EXTERNAL_SERVICE=true. You can start a local dev server by using Temporal CLI: temporal server start-dev --namespace UnitTest --search-attribute CustomKeywordField=Keyword
|
Hello @maciejdudko , The original change made the test server inherit memos and search attributes on To address this, I made the following changes:
I confirmed that all tests pass both on the test server and on a real dev server ( Whenever you have a moment, I would appreciate it if you could take another look. |
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-flightupsertMemo/upsertTypedSearchAttributesmutations.Specifically:
StateMachinesnow populates memo and search attributes on theWorkflowExecutionContinuedAsNewevent, falling back to the live workflow state when the command omits the field.TestWorkflowServicenow copies memo from theWorkflowExecutionContinuedAsNewevent 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
ContinueAsNewruns that rely on inherited memo or search attributes. This made the test server unreliable for verifying memo/search-attribute-dependent workflow logic.Checklist
Closes Testing server continue-as-new doesn't carry search attributes #2655.
How was this tested:
ContinueAsNewTestcovering inherit, override, upsert-then-inherit for memo and search attributes, upsert-null memo removal, and explicit empty memo override.No. This is an internal test server behavior fix that aligns it with the real Temporal service; no public API change.