@Override
    public void handleGlobalFailure(
            Throwable cause, CompletableFuture<Map<String, String>> failureLabels) {
        context.goToFinished(context.getArchivedExecutionGraph(JobStatus.FAILED, cause));
    }
@Test
    void testTransitionToFinishedOnGlobalFailure() {
        TestingStateWithoutExecutionGraph state = new TestingStateWithoutExecutionGraph(ctx, LOG);
        RuntimeException expectedException = new RuntimeException("This is a test exception");

        ctx.setExpectFinished(
                archivedExecutionGraph -> {
                    assertThat(archivedExecutionGraph.getState()).isEqualTo(JobStatus.FAILED);
                    assertThat(archivedExecutionGraph.getFailureInfo()).isNotNull();
                    assertThat(
                                    archivedExecutionGraph
                                            .getFailureInfo()
                                            .getException()
                                            .deserializeError(this.getClass().getClassLoader()))
                            .isEqualTo(expectedException);
                });

        state.handleGlobalFailure(expectedException, FailureEnricherUtils.EMPTY_FAILURE_LABELS);
    }