@@ -13,10 +13,6 @@ import { from_dynamic as decodeTestRunResult } from "./unitest/internal/outcome.
1313// backstop) from racing that and terminating a worker that was about to report.
1414const WORKER_WATCHDOG_GRACE_MS = 100 ;
1515
16- function formatError ( err ) {
17- return err == null ? String ( err ) : err . message || String ( err ) ;
18- }
19-
2016function makeGenericError ( message ) {
2117 return decodeTestRunResult ( { kind : "error" , message } ) ;
2218}
@@ -26,7 +22,7 @@ function crashedOutcome(error) {
2622 kind : "error" ,
2723 failureKind : {
2824 type : "crashed" ,
29- reason : formatError ( error ) ,
25+ reason : error == null ? String ( error ) : error . message || String ( error ) ,
3026 stack : parseStack ( error ) ,
3127 } ,
3228 } ) ;
@@ -345,10 +341,6 @@ function startWithWorkerThreads(
345341 } ) ;
346342 }
347343
348- function isAsyncTimeoutResult ( result ) {
349- return result ?. failureKind ?. type === "timeout" ;
350- }
351-
352344 function recycleWorker ( w ) {
353345 w . _done = true ;
354346 w . terminate ( ) ;
@@ -414,7 +406,7 @@ function startWithWorkerThreads(
414406 ) ,
415407 ) ;
416408 }
417- if ( isAsyncTimeoutResult ( msg . result ) ) {
409+ if ( msg . result ?. failureKind ?. type === "timeout" ) {
418410 // Promise.race cannot cancel the losing test; it is still running
419411 // inside this worker. Recycle the worker so its side effects cannot
420412 // interfere with later tests. Deliberate, so it does not count
0 commit comments