File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ public function testTimeoutIsNotAFatalError()
109
109
{
110
110
$ client = $ this ->getHttpClient (__FUNCTION__ );
111
111
$ response = $ client ->request ('GET ' , 'http://localhost:8057/timeout-body ' , [
112
- 'timeout ' => 0.1 ,
112
+ 'timeout ' => 0.3 ,
113
113
]);
114
114
115
115
try {
@@ -118,8 +118,17 @@ public function testTimeoutIsNotAFatalError()
118
118
} catch (TransportException $ e ) {
119
119
}
120
120
121
- usleep (400000 );
122
- $ this ->assertSame ('<1><2> ' , $ response ->getContent ());
121
+ for ($ i = 0 ; $ i < 10 ; ++$ i ) {
122
+ try {
123
+ $ this ->assertSame ('<1><2> ' , $ response ->getContent ());
124
+ break ;
125
+ } catch (TransportException $ e ) {
126
+ }
127
+ }
128
+
129
+ if (10 === $ i ) {
130
+ throw $ e ;
131
+ }
123
132
}
124
133
125
134
public function testResponseStreamRewind ()
You can’t perform that action at this time.
0 commit comments