File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,11 @@ function runWorkerMessage(messageToSend: any): Promise<{ msg: any; worker: Worke
6969 // Add timeout to prevent hanging
7070 setTimeout ( ( ) => {
7171 if ( ! resolved ) {
72- if ( process . env . CI ) {
73- console . error ( '[worker-diag] timeout waiting for CACHE_MAIN_SCRIPTS; terminating worker to avoid dangling thread' )
74- try { worker . terminate ( ) } catch { }
75- console . log ( 'Timeout waiting for CACHE_MAIN_SCRIPTS message. This is expected to sometimes fail in CI, but need to investigate why...' )
76- } else {
77- reject ( new Error ( 'Timeout waiting for CACHE_MAIN_SCRIPTS message' ) )
78- }
72+ // Always fail fast with a clear error and terminate the worker.
73+ // Avoid leaving a pending Promise which causes AVA to time out.
74+ console . error ( '[worker-diag] timeout waiting for CACHE_MAIN_SCRIPTS; terminating worker to avoid dangling thread' )
75+ try { worker . terminate ( ) } catch { }
76+ reject ( new Error ( 'Timeout waiting for CACHE_MAIN_SCRIPTS message' ) )
7977 }
8078 } , 5000 )
8179 } )
You can’t perform that action at this time.
0 commit comments