sdk-java icon indicating copy to clipboard operation
sdk-java copied to clipboard

TestEnvironment with external service - failing tests throws IllegalStateException errors

Open gauravthadani opened this issue 3 months ago • 1 comments

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:

gauravthadani avatar Sep 29 '25 00:09 gauravthadani

Hi @gauravthadani, thank you for opening this issue. We'll discuss it on our next triage meeting.

maciejdudko avatar Oct 01 '25 15:10 maciejdudko