@@ -2423,7 +2423,7 @@ describe('supports http with nodejs', function () {
24232423 } ) ;
24242424
24252425 it ( 'should support request cancellation' , async function ( ) {
2426- if ( typeof AbortSignal !== 'function' ) {
2426+ if ( typeof AbortSignal !== 'function' || ! AbortSignal . timeout ) {
24272427 this . skip ( ) ;
24282428 }
24292429
@@ -2525,13 +2525,17 @@ describe('supports http with nodejs', function () {
25252525
25262526 it ( "should use different sessions for different authorities" , async ( ) => {
25272527 server = await startHTTPServer ( ( req , res ) => {
2528- setTimeout ( ( ) => res . end ( 'OK' ) , 1000 ) ;
2528+ setTimeout ( ( ) => {
2529+ res . end ( 'OK' ) ;
2530+ } , 2000 ) ;
25292531 } , {
25302532 useHTTP2 : true
25312533 } ) ;
25322534
25332535 server2 = await startHTTPServer ( ( req , res ) => {
2534- setTimeout ( ( ) => res . end ( 'OK' ) , 1000 ) ;
2536+ setTimeout ( ( ) => {
2537+ res . end ( 'OK' ) ;
2538+ } , 2000 ) ;
25352539 } , {
25362540 useHTTP2 : true ,
25372541 port : SERVER_PORT2
@@ -2559,7 +2563,9 @@ describe('supports http with nodejs', function () {
25592563
25602564 it ( "should use different sessions for requests with different http2Options set" , async ( ) => {
25612565 server = await startHTTPServer ( ( req , res ) => {
2562- setTimeout ( ( ) => res . end ( 'OK' ) , 1000 ) ;
2566+ setTimeout ( ( ) => {
2567+ res . end ( 'OK' )
2568+ } , 1000 ) ;
25632569 } , {
25642570 useHTTP2 : true
25652571 } ) ;
@@ -2639,6 +2645,8 @@ describe('supports http with nodejs', function () {
26392645 }
26402646 } ) ;
26412647
2648+ const data1 = await getStream ( response1 . data ) ;
2649+
26422650 await setTimeoutAsync ( 5000 ) ;
26432651
26442652 const response2 = await http2Axios . get ( LOCAL_SERVER_URL , {
@@ -2648,15 +2656,12 @@ describe('supports http with nodejs', function () {
26482656 }
26492657 } ) ;
26502658
2659+ const data2 = await getStream ( response2 . data ) ;
2660+
26512661 assert . notStrictEqual ( response1 . data . session , response2 . data . session ) ;
26522662
2653- assert . deepStrictEqual (
2654- await Promise . all ( [
2655- getStream ( response1 . data ) ,
2656- getStream ( response2 . data )
2657- ] ) ,
2658- [ 'OK' , 'OK' ]
2659- ) ;
2663+ assert . strictEqual ( data1 , 'OK' ) ;
2664+ assert . strictEqual ( data2 , 'OK' ) ;
26602665 } ) ;
26612666 } ) ;
26622667 } ) ;
0 commit comments