@@ -58,12 +58,17 @@ const env = {
58
58
env,
59
59
} ) ;
60
60
console . log ( child . stdout . toString ( ) ) ;
61
- console . log ( child . stderr . toString ( ) ) ;
61
+ const stderr = child . stderr . toString ( ) ;
62
+ console . log ( stderr ) ;
62
63
assert ( common . nodeProcessAborted ( child . status , child . signal ) ,
63
64
'process should have aborted, but did not' ) ;
64
65
const list = fs . readdirSync ( tmpdir . path )
65
66
. filter ( ( file ) => file . endsWith ( '.heapsnapshot' ) ) ;
66
- assert . strictEqual ( list . length , 1 ) ;
67
+ const risky = [ ...stderr . matchAll (
68
+ / N o t g e n e r a t i n g s n a p s h o t s b e c a u s e i t ' s t o o r i s k y / g) ] . length ;
69
+ assert ( list . length + risky > 0 && list . length <= 3 ,
70
+ `Generated ${ list . length } snapshots ` +
71
+ `and ${ risky } was too risky` ) ;
67
72
}
68
73
69
74
{
@@ -79,10 +84,15 @@ const env = {
79
84
env,
80
85
} ) ;
81
86
console . log ( child . stdout . toString ( ) ) ;
82
- console . log ( child . stderr . toString ( ) ) ;
87
+ const stderr = child . stderr . toString ( ) ;
88
+ console . log ( stderr ) ;
83
89
assert ( common . nodeProcessAborted ( child . status , child . signal ) ,
84
90
'process should have aborted, but did not' ) ;
85
91
const list = fs . readdirSync ( tmpdir . path )
86
92
. filter ( ( file ) => file . endsWith ( '.heapsnapshot' ) ) ;
87
- assert ( list . length > 0 && list . length <= 3 ) ;
93
+ const risky = [ ...stderr . matchAll (
94
+ / N o t g e n e r a t i n g s n a p s h o t s b e c a u s e i t ' s t o o r i s k y / g) ] . length ;
95
+ assert ( list . length + risky > 0 && list . length <= 3 ,
96
+ `Generated ${ list . length } snapshots ` +
97
+ `and ${ risky } was too risky` ) ;
88
98
}
0 commit comments