File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -810,6 +810,38 @@ public function testTimeoutWithActiveConcurrentStream()
810
810
}
811
811
}
812
812
813
+ public function testTimeoutOnDestruct ()
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
+ while ($ response = array_shift ($ responses )) {
829
+ try {
830
+ unset($ response );
831
+ $ this ->fail (TransportExceptionInterface::class.' expected ' );
832
+ } catch (TransportExceptionInterface $ e ) {
833
+ }
834
+ }
835
+
836
+ $ duration = microtime (true ) - $ start ;
837
+
838
+ $ this ->assertLessThan (1.0 , $ duration );
839
+ } finally {
840
+ $ p1 ->stop ();
841
+ $ p2 ->stop ();
842
+ }
843
+ }
844
+
813
845
public function testDestruct ()
814
846
{
815
847
$ client = $ this ->getHttpClient (__FUNCTION__ );
You can’t perform that action at this time.
0 commit comments