temporalio / temporalio/sdk-java

TestEnvironment with external service - failing tests throws IllegalStateException errors

Open
#2,674 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

TestWorkflowExtension throws diagnostics error when

  • using useExternalService
  • and tests Fail

https://github.com/temporalio/sdk-java/blob/master/temporal-testing/src/main/java/io/temporal/testing/TestWorkflowEnvironmentInternal.java#L262

Expected Behavior


Failed tests
.
.
.

Actual Behavior

java.lang.IllegalStateException: getDiagnostics is not supported with the external service
	at com.google.common.base.Preconditions.checkState(Preconditions.java:512)

Steps to Reproduce the Problem

class SampleTest {

  @RegisterExtension
  public static final TestWorkflowExtension workflowExtension =
      TestWorkflowExtension.newBuilder().setDoNotStart(true).useExternalService().build();

  @Test
  void sampleTest(TestWorkflowEnvironment environment) {
    Assert.assertEquals(1, 2);
  }
}

Specifications

  • Version:
  • Platform:

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 at temporal-testing/src/main/java/io/temporal/testing/TestWorkflowEnvironmentInternal.java around line 262 and reproduce the failure with TestWorkflowExtension configured with useExternalService and setDoNotStart(true). Trace why a failing test reaches the unsupported diagnostics call; done means the test reports its assertion failure instead of an IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.