File tree 3 files changed +26
-19
lines changed
packages/compass-e2e-tests/helpers 3 files changed +26
-19
lines changed Original file line number Diff line number Diff line change 81
81
params :
82
82
local_files_include_filter :
83
83
- src/packages/compass-e2e-tests/.log/**/*
84
- - << : *save-diagnostic-file
85
- params :
86
- local_files_include_filter :
87
84
- src/packages/compass-e2e-tests/.nyc_output/coverage.json
88
- - << : *save-diagnostic-file
89
- params :
90
- local_files_include_filter :
85
+ - src/packages/compass-e2e-tests/.log/report.json
91
86
- ~/.mongodb/runner/*.log
92
- - command : attach.results
93
- params :
94
- file_location : src/packages/compass-e2e-tests/.log/report.json
95
87
96
88
functions :
97
89
clone :
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export async function shellEval(
57
57
} catch ( err ) {
58
58
// just leave it unparsed for now if there's a parse error because
59
59
// that's really helpful when debugging
60
+ console . error ( 'Could not parse result:' , result ) ;
60
61
}
61
62
}
62
63
Original file line number Diff line number Diff line change @@ -628,18 +628,32 @@ export async function afterTests(
628
628
await compass . capturePage ( filename ) ;
629
629
}
630
630
631
- try {
632
- await compass . stop ( test ) ;
633
- } catch ( err ) {
634
- debug ( 'An error occurred while stopping compass:' ) ;
635
- debug ( err ) ;
631
+ let timeoutId ;
632
+ const timeoutPromise = new Promise < void > ( ( resolve ) => {
633
+ timeoutId = setTimeout ( ( ) => {
634
+ console . error ( 'It took too long to close compass' ) ;
635
+ resolve ( ) ;
636
+ } , 30000 ) ;
637
+ } ) ;
638
+
639
+ const closePromise = ( async function close ( ) : Promise < void > {
636
640
try {
637
- // make sure the process can exit
638
- await compass . browser . deleteSession ( ) ;
639
- } catch ( _ ) {
640
- debug ( 'browser already closed' ) ;
641
+ await compass . stop ( test ) ;
642
+ } catch ( err ) {
643
+ debug ( 'An error occurred while stopping compass:' ) ;
644
+ debug ( err ) ;
645
+ try {
646
+ // make sure the process can exit
647
+ await compass . browser . deleteSession ( ) ;
648
+ } catch ( _ ) {
649
+ debug ( 'browser already closed' ) ;
650
+ }
641
651
}
642
- }
652
+ clearTimeout ( timeoutId ) ;
653
+ return ;
654
+ } ) ( ) ;
655
+
656
+ return Promise . race ( [ timeoutPromise , closePromise ] ) ;
643
657
}
644
658
645
659
function pathName ( text : string ) {
You can’t perform that action at this time.
0 commit comments