temporalio / temporalio/sdk-java

Add test framework for partial json history replay and continuing of execution

Open
#811 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
433
Forks
249
Avg merge
5d 6h
Merged PRs (30d)
26

Description

Is your feature request related to a problem? Please describe.
We have a framework that allows launching workflows from scratch.
We also have a way to make a full history replay using query functionality. See WorkflowReplayer that falls back to worker.queryWorkflowExecution(history, WorkflowClient.QUERY_TYPE_REPLAY_ONLY, ...)
We don't have a way to make a replay of a partial json history and continue the execution (aka restoring from a failure).
It's supported for our state machines testing framework, but not for workflow integration testing framework.
Which limits what kind of state machines permutation we can cover with functional tests and limits our ability to test replayability by itself.

Describe the solution you'd like
Add an ability for our TestService to load a partial workflow history from a json, restore a workflow mutable state from it and dispatch workflow tasks to continue execution on a worker simulating restoring after a failure or after a worker cache eviction.

Describe alternatives you've considered
Alternatively, to get the same result in the test, we can simulate a failure the first time at the place in a workflow we want to get a replay to. But this is a hacky way to achieve to goal and also it doesn't allow us to test compatibility with histories produced in older versions of SDKs.
Alternatively, we can continue to don't have tests covering continue execution after a partial replay.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the WorkflowReplayer and TestService, including the worker.queryWorkflowExecution(history, WorkflowClient.QUERY_TYPE_REPLAY_ONLY, ...) path. Trace how workflow history is loaded and mutable state is restored, then verify that a partial JSON history can dispatch workflow tasks and continue execution on a worker, including histories from older SDK versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.