File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -810,6 +810,39 @@ public function testTimeoutWithActiveConcurrentStream()
810
810
}
811
811
}
812
812
813
+ public function testTimeoutOnInitialize ()
814
+ {
815
+ $ p1 = TestHttpServer::start (8067 );
816
+ $ p2 = TestHttpServer::start (8077 );
817
+
818
+ $ client = $ this ->getHttpClient (__FUNCTION__ );
819
+ $ start = microtime (true );
820
+ $ responses = [];
821
+
822
+ $ responses [] = $ client ->request ('GET ' , 'http://localhost:8067/timeout-header ' , ['timeout ' => 0.25 ]);
823
+ $ responses [] = $ client ->request ('GET ' , 'http://localhost:8077/timeout-header ' , ['timeout ' => 0.25 ]);
824
+ $ responses [] = $ client ->request ('GET ' , 'http://localhost:8067/timeout-header ' , ['timeout ' => 0.25 ]);
825
+ $ responses [] = $ client ->request ('GET ' , 'http://localhost:8077/timeout-header ' , ['timeout ' => 0.25 ]);
826
+
827
+ try {
828
+ foreach ($ responses as $ response ) {
829
+ try {
830
+ $ response ->getContent ();
831
+ $ this ->fail (TransportExceptionInterface::class.' expected ' );
832
+ } catch (TransportExceptionInterface $ e ) {
833
+ }
834
+ }
835
+ $ responses = [];
836
+
837
+ $ duration = microtime (true ) - $ start ;
838
+
839
+ $ this ->assertLessThan (1.0 , $ duration );
840
+ } finally {
841
+ $ p1 ->stop ();
842
+ $ p2 ->stop ();
843
+ }
844
+ }
845
+
813
846
public function testTimeoutOnDestruct ()
814
847
{
815
848
$ p1 = TestHttpServer::start (8067 );
You can’t perform that action at this time.
0 commit comments