From dc17c9003f2f576751ec7a6fa010ef2d842efb1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Wed, 23 Apr 2025 12:39:16 +0200 Subject: [PATCH] ensure old tests can exit properly on using the new closeAllWatchers --- tools/tests/old/test-bundler-assets.js | 9 ++++++++- tools/tests/old/test-bundler-options.js | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/tests/old/test-bundler-assets.js b/tools/tests/old/test-bundler-assets.js index c0c1278434..6f7479f7bc 100644 --- a/tools/tests/old/test-bundler-assets.js +++ b/tools/tests/old/test-bundler-assets.js @@ -172,6 +172,13 @@ makeGlobalAsyncLocalStorage().run( // Allow the process to exit normally, since optimistic file watchers // may be keeping the event loop busy. - safeWatcher.closeAllWatchers(); + safeWatcher.closeAllWatchers() + .then(() => { + process.exit(0); + }) + .catch(err => { + console.error(`Error closing watchers:`, err); + process.exit(1); + }); } ); diff --git a/tools/tests/old/test-bundler-options.js b/tools/tests/old/test-bundler-options.js index 2bf8d00aa1..871146afb6 100644 --- a/tools/tests/old/test-bundler-options.js +++ b/tools/tests/old/test-bundler-options.js @@ -200,6 +200,13 @@ makeGlobalAsyncLocalStorage().run( // Allow the process to exit normally, since optimistic file watchers // may be keeping the event loop busy. - safeWatcher.closeAllWatchers(); + safeWatcher.closeAllWatchers() + .then(() => { + process.exit(0); + }) + .catch(err => { + console.error(`Error closing watchers:`, err); + process.exit(1); + }); } );