Skip to content

TestEnvironment with external service - failing tests throws IllegalStateException errors #2674

@gauravthadani

Description

@gauravthadani

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions