@@ -521,7 +521,6 @@ public function testFlowControl(): void
521521 self ::markTestSkipped ('Not supported with nghttp2, disable ffi for this test. ' );
522522 }
523523
524- $ this ->initDriver ();
525524 $ request = async (fn () => $ this ->whenRequestIsReceived ());
526525
527526 $ input = new Queue ;
@@ -868,6 +867,46 @@ public function testSendingLargeHeaders(): void
868867 self ::assertSame ($ value , $ request ->getHeader ($ header ));
869868 }
870869
870+ public function testTimeoutSuspendedDuringRequestHandler (): void
871+ {
872+ $ requestHandler = new ClosureRequestHandler (function (): Response {
873+ delay (2 );
874+ return new Response (HttpStatus::ACCEPTED , body: 'Hello World! ' );
875+ });
876+
877+ $ this ->driver = new Http2Driver (
878+ $ requestHandler ,
879+ $ this ->createMock (ErrorHandler::class),
880+ new NullLogger ,
881+ streamTimeout: 1 ,
882+ connectionTimeout: 1 ,
883+ );
884+
885+ $ headers = [
886+ ":authority " => ["localhost:8888 " ],
887+ ":path " => ["/ " ],
888+ ":scheme " => ["https " ],
889+ ":method " => ["GET " ],
890+ ];
891+
892+ $ input = new Queue ();
893+ $ this ->givenInput (new ReadableIterableStream ($ input ->iterate ()));
894+ $ frames = $ this ->whenReceivingFrames ();
895+
896+ $ input ->push (Http2Parser::PREFACE );
897+ $ input ->push (self ::packHeader ($ headers ));
898+
899+ $ frames ->continue (); // Skip settings frame.
900+
901+ self ::assertTrue ($ frames ->continue ());
902+ $ frame = $ frames ->getValue ();
903+ self ::assertSame (Http2Parser::HEADERS , $ frame ['type ' ]);
904+ self ::assertSame (Http2Parser::END_HEADERS , $ frame ['flags ' ]);
905+ self ::assertSame (1 , $ frame ['stream ' ]);
906+
907+ $ input ->complete ();
908+ }
909+
871910 protected function givenPush (string $ uri ): void
872911 {
873912 $ this ->pushes [] = $ uri ;
0 commit comments