TestWorkflowEnvironment sleep incorrect behaviour
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by reproducing the issue with TestWorkflowEnvironment.sleep(Duration.ofDays(1)) in isolation and after the child-workflow test shown in the report. Inspect the TestWorkflowEnvironment lifecycle and child-workflow execution path to identify what changes virtual-time behavior. Done means the sleep advances instantly in the full integration suite as well as when run alone.
索引モデルが issue の本文から書いたものです。
説明
Expected Behavior
Integration tests with Temporal should not actually sleep or wait when using TestWorkflowEnvironment.sleep().
The virtual time should advance instantly, regardless of other tests being executed before.
Actual Behavior
In some cases, tests sleep and wait in real time instead of using virtual time.
This happens when a test using TestWorkflowEnvironment.sleep() runs after another test that executed a child workflow.
Steps to Reproduce the Problem
-
Use Temporal library 1.30.1 with io.temporal:temporal-spring-boot-starter.
-
Have a workflow with setStartDelay().
-
Write an integration test that relies on TestWorkflowEnvironment.sleep(Duration.ofDays(1)).
When run in isolation, the test passes instantly (virtual time works).
-
Add another test that uses a child workflow, e.g.:
TestWorkflow transferWorkflow =
Workflow.newChildWorkflowStub(
TestWorkflow.class,
ChildWorkflowOptions.newBuilder()
.setWorkflowId("test-id")
.setTaskQueue("test-task-queues")
.setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
.setWorkflowIdReusePolicy(WorkflowIdReusePolicy.WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE)
.setRetryOptions(RetryOptions.newBuilder()
.setMaximumAttempts(MAXIMUM_ATTEMPTS)
.build())
.build()
);
Async.procedure(() -> transferWorkflow.test(test.testId()));
Promise<WorkflowExecution> childExecution = Workflow.getWorkflowExecution(transferWorkflow);
childExecution.get();
- Run the whole test suite.
The test with sleep(Duration.ofDays(1)) now sleeps in real time instead of advancing virtual time.
Notes
Behavior is consistent:
✅ Works when the test with sleep is executed alone.
❌ Breaks when a test with a child workflow ran before it.
Looks like something in the child workflow test "switches" the TestWorkflowEnvironment from virtual time to real time.
Specifications
Version: 1.30.1
Platform: Java
Dependency: io.temporal:temporal-spring-boot-starter
- 主要言語
- Java
- スター
- 433
- フォーク
- 249
- 平均マージ
- 6日 5時間
- マージ済み PR(30日)
- 25
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
temporalio/sdk-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
temporalio/sdk-java#2676 · コメント 8 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
temporalio/sdk-java#1825 ·
メンテナーはふだん 1 日以内に返信
-
test server
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
temporalio/sdk-java#3088 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Warn if the SDK tried to send a payload above a specific size - Java対応中かも @jmaeagle99 が 17 日前に担当しました。 オープン
temporalio/sdk-java#3059 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Allow configurable prefix for MDC keys対応中かも @maciejdudko が 17 日前に担当しました。 オープンenhancement
temporalio/sdk-java#3058 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
temporalio/sdk-java の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
ci-failure-cause test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nextcloud/notes-android#3367 ·
メンテナーはふだん 1 日以内に返信
-
:wave: team-triage a:chore in:isolated-projects in:kotlin-dsl
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信