From 967b6a264d97163d56d4d8774662e5d57ca533ca Mon Sep 17 00:00:00 2001
From: Jaswant Panchumarti <jaswant.panchumarti@kitware.com>
Date: Fri, 28 Feb 2025 14:59:53 -0500
Subject: [PATCH] wasm-test-runner: handle keyboard interrupt when engine is
 running

---
 Testing/WebAssembly/runner.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Testing/WebAssembly/runner.py b/Testing/WebAssembly/runner.py
index f231a82ccdb..18d19fc5628 100644
--- a/Testing/WebAssembly/runner.py
+++ b/Testing/WebAssembly/runner.py
@@ -212,6 +212,9 @@ class vtkWebAssemblyTestRunner:
                 logger.error(e)
                 self._server_is_shutdown = True
                 self.exit_code = 1
+            except KeyboardInterrupt:
+                self.exit_code = 1
+                self._server_is_shutdown = True
         else:
             logger.info(f"An engine was not specified. Script may appear to hang but it is actually running a http server.")
         # If a test did not send an exit code, this `join` will block. It can happen when a test is stuck.
-- 
GitLab