@@ -22,23 +22,24 @@ const child = fork(__filename, ['test'], {
2222 execArgv : [ '--trace-tls' ]
2323} ) ;
2424
25+ let stdout = '' ;
2526let stderr = '' ;
27+ child . stdout . setEncoding ( 'utf8' ) ;
2628child . stderr . setEncoding ( 'utf8' ) ;
29+ child . stdout . on ( 'data' , ( data ) => stdout += data ) ;
2730child . 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 ( ) , '' ) ;
2938 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 ) ) ;
3039 assert ( / R e c e i v e d R e c o r d / . test ( stderr ) ) ;
3140 assert ( / C l i e n t H e l l o / . test ( stderr ) ) ;
3241} ) ) ;
3342
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-
4243function test ( ) {
4344 const {
4445 connect, keys
@@ -54,6 +55,13 @@ function test() {
5455 key : keys . agent6 . key
5556 } ,
5657 } , 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+
5765 return cleanup ( ) ;
5866 } ) ) ;
5967}
0 commit comments