File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,18 @@ test('app launches and loads UI from server', async () => {
2323 await expect ( window . locator ( 'h1:has-text("Intercept HTTP")' ) ) . toBeVisible ( { timeout : 60000 } ) ;
2424 console . log ( 'saw title' ) ;
2525
26- await electronApp . close ( ) ;
26+ await Promise . race ( [
27+ electronApp . close ( ) ,
28+ new Promise ( ( _ , reject ) => setTimeout ( ( ) => reject ( new Error ( 'App failed to close cleanly' ) ) , 5000 ) )
29+ ] ) . catch ( async ( error ) => {
30+ console . warn ( 'Warning:' , error . message , '- force killing process' ) ;
31+ electronApp . process ( ) . kill ( 'SIGKILL' ) ;
32+ if ( ! process . env . CI ) {
33+ console . log ( '(Note that shutdown issues like this are ignored in CI)' ) ;
34+ throw error ;
35+ } else {
36+ console . log ( 'Ignoring error (assuming this is a CI issue)' )
37+ }
38+ } ) ;
2739 console . log ( 'closed app' ) ;
2840} ) ;
You can’t perform that action at this time.
0 commit comments