Skip to content

Commit a165035

Browse files
author
Mine Starks
committed
add uncaught exception handler
1 parent ae43fed commit a165035

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/vscode/test/runTests.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ const thisDir = dirname(fileURLToPath(import.meta.url));
4848
// The folder containing the Extension Manifest package.json
4949
const extensionDevelopmentPath = join(thisDir, "..");
5050

51+
// @vscode/test-web tends to throw uncaught exceptions on network failures
52+
// https://github.com/microsoft/vscode-test-web/issues/175
53+
// Workaround copied from https://github.com/hilleer/vscode-yaml-plus-json/pull/146/files
54+
process.on("uncaughtException", () => {
55+
console.warn("Ignoring uncaught exception during test run.");
56+
}); // ignore those, expected, should still be able to rely on tests
57+
5158
try {
5259
const suites = ["language-service", "debugger"];
5360
const toRun =
@@ -91,6 +98,7 @@ async function runSuite(name) {
9198
break;
9299
} catch (err) {
93100
// Until the @vscode/test-web library is more robust, we have our own retry logic for VS Code download errors.
101+
// https://github.com/microsoft/vscode-test-web/issues/175
94102
// We want to be conservative about what errors we retry on, to avoid masking real test failures.
95103
//
96104
// Pattern for network errors adapted from

0 commit comments

Comments
 (0)