@@ -22,23 +22,24 @@ const child = fork(__filename, ['test'], {
22
22
execArgv : [ '--trace-tls' ]
23
23
} ) ;
24
24
25
+ let stdout = '' ;
25
26
let stderr = '' ;
27
+ child . stdout . setEncoding ( 'utf8' ) ;
26
28
child . stderr . setEncoding ( 'utf8' ) ;
29
+ child . stdout . on ( 'data' , ( data ) => stdout += data ) ;
27
30
child . stderr . on ( 'data' , ( data ) => stderr += data ) ;
28
- child . on ( 'close' , common . mustCall ( ( ) => {
31
+ child . on ( 'close' , common . mustCall ( ( code , signal ) => {
32
+ // For debugging and observation of actual trace output.
33
+ console . log ( stderr ) ;
34
+
35
+ assert . strictEqual ( code , 0 ) ;
36
+ assert . strictEqual ( signal , null ) ;
37
+ assert . strictEqual ( stdout . trim ( ) , '' ) ;
29
38
assert ( / W a r n i n g : E n a b l i n g - - t r a c e - t l s c a n e x p o s e s e n s i t i v e / . test ( stderr ) ) ;
30
39
assert ( / R e c e i v e d R e c o r d / . test ( stderr ) ) ;
31
40
assert ( / C l i e n t H e l l o / . test ( stderr ) ) ;
32
41
} ) ) ;
33
42
34
- // For debugging and observation of actual trace output.
35
- child . stderr . pipe ( process . stderr ) ;
36
- child . stdout . pipe ( process . stdout ) ;
37
-
38
- child . on ( 'exit' , common . mustCall ( ( code ) => {
39
- assert . strictEqual ( code , 0 ) ;
40
- } ) ) ;
41
-
42
43
function test ( ) {
43
44
const {
44
45
connect, keys
@@ -54,6 +55,13 @@ function test() {
54
55
key : keys . agent6 . key
55
56
} ,
56
57
} , common . mustCall ( ( err , pair , cleanup ) => {
58
+ if ( err ) {
59
+ console . error ( err ) ;
60
+ console . error ( err . opensslErrorStack ) ;
61
+ console . error ( err . reason ) ;
62
+ assert ( err ) ;
63
+ }
64
+
57
65
return cleanup ( ) ;
58
66
} ) ) ;
59
67
}
0 commit comments