@Override
    public void close() {
        this.displayResultExecutorService.shutdown();
    }
@Test
    void testCancelBatchResult() throws Exception {
        final Configuration testConfig = new Configuration();
        testConfig.set(EXECUTION_RESULT_MODE, ResultMode.TABLEAU);
        testConfig.set(RUNTIME_MODE, RuntimeExecutionMode.BATCH);
        testConfig.set(DISPLAY_QUERY_TIME_COST, false);

        ResultDescriptor resultDescriptor =
                new ResultDescriptor(CliClientTestUtils.createTestClient(schema), testConfig);
        TestChangelogResult collectResult =
                new TestChangelogResult(
                        () -> TypedResult.payload(data.subList(0, data.size() / 2)),
                        TypedResult::empty);
        CliTableauResultView view =
                new CliTableauResultView(
                        terminal, resultDescriptor, collectResult, System.currentTimeMillis());

        // submit result display in another thread
        Future<?> furture = EXECUTOR_RESOURCE.getExecutor().submit(view::displayResults);

        // wait until we try to get blocking iterator
        CommonTestUtils.waitUntilCondition(() -> collectResult.fetchCount.get() > 1, 50L);

        // send signal to cancel
        terminal.raise(Terminal.Signal.INT);
        furture.get(5, TimeUnit.SECONDS);

        assertThat(terminalOutput)
                .hasToString(
                        "Query terminated, received a total of 0 row" + System.lineSeparator());

        assertThat(collectResult.closed).isTrue();
        view.close();
    }