public void executeInInteractiveMode() {
        executeInInteractiveMode(null);
    }
@Test
    void testCancelExecutionInteractiveMode() throws Exception {
        final MockExecutor mockExecutor = new MockExecutor(new SqlParserHelper(), true);

        Path historyFilePath = historyTempFile();
        InputStream inputStream = new ByteArrayInputStream("SELECT 1;\nHELP;\n ".getBytes());
        OutputStream outputStream = new ByteArrayOutputStream(248);

        try (Terminal terminal = TerminalUtils.createDumbTerminal(inputStream, outputStream);
                CliClient client =
                        new CliClient(() -> terminal, mockExecutor, historyFilePath, null)) {
            CheckedThread thread =
                    new CheckedThread() {
                        @Override
                        public void go() {
                            client.executeInInteractiveMode();
                        }
                    };
            thread.start();

            while (!mockExecutor.isAwait) {
                Thread.sleep(10);
            }

            terminal.raise(Terminal.Signal.INT);
            CommonTestUtils.waitUntilCondition(
                    () -> outputStream.toString().contains(CliStrings.MESSAGE_HELP));
            // Prevent NPE when closing the terminal. See FLINK-33116 for more information.
            thread.sync();
        }
    }