TestWorkflowEnvironment sleep incorrect behaviour
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Java
- Estrellas
- 433
- Forks
- 249
- Merge medio
- 6 d 5 h
- PR fusionados (30 d)
- 25
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de temporalio/sdk-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
temporalio/sdk-java#2676 · 8 comentarios · 2 reacciones ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
temporalio/sdk-java#1825 ·
-
test server
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
temporalio/sdk-java#3088 · 2 comentarios ·
-
temporalio/sdk-java#3059 · 1 asignado ·
-
enhancement
temporalio/sdk-java#3058 · 1 asignado ·
Todos los issues de temporalio/sdk-java
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
objectionary/jeo-maven-plugin#1811 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
hiero-ledger/hiero-block-node#3693 ·
-
area/dependencies kind/cve severity/critical source/scan-dependencies status/triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
proposal
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
beemdevelopment/Aegis#1840 ·