public CompletableFuture<Result> getTerminationFuture() {
        return terminationFuture;
    }
@Test
    void testWorkingDirIsNotDeletedInCaseOfFailure() throws Exception {
        final File workingDirBase = TempDirUtils.newFolder(temporaryFolder);
        final ResourceID resourceId = ResourceID.generate();

        final Configuration configuration =
                createConfigurationWithWorkingDirectory(workingDirBase, resourceId);

        final TaskManagerRunner taskManagerRunner =
                createTaskManagerRunner(
                        configuration, new TestingFailingTaskExecutorServiceFactory());

        taskManagerRunner.getTerminationFuture().join();

        assertThat(
                        ClusterEntrypointUtils.generateTaskManagerWorkingDirectoryFile(
                                configuration, resourceId))
                .exists();
    }