public void close() throws Exception {
        try {
            closeAsync().get();
        } catch (ExecutionException e) {
            ExceptionUtils.rethrowException(ExceptionUtils.stripExecutionException(e));
        }
    }
@Test
    void testWorkingDirIsSetupWhenStartingTaskManagerRunner() throws Exception {
        final File workingDirBase = TempDirUtils.newFolder(temporaryFolder);
        final ResourceID taskManagerResourceId = new ResourceID("foobar");

        final Configuration configuration =
                createConfigurationWithWorkingDirectory(workingDirBase, taskManagerResourceId);
        final File workingDir =
                ClusterEntrypointUtils.generateTaskManagerWorkingDirectoryFile(
                        configuration, taskManagerResourceId);
        final TaskManagerRunner taskManagerRunner = createTaskManagerRunner(configuration);

        try {
            assertThat(workingDir).exists();
        } finally {
            taskManagerRunner.close();
        }

        assertThat(workingDir)
                .withFailMessage(
                        "The working dir should be cleaned up when stopping the TaskManager process gracefully.")
                .doesNotExist();
    }