@@ -112,11 +112,7 @@ public function testWriteClientLogin(Client $client, \stdClass $message)
112112 $ message = $ this ->awaitMessage ($ client );
113113 $ this ->assertEquals ('ClientLoginAck ' , $ message ->MsgType );
114114
115- try {
116- $ message = $ this ->awaitMessage ($ client );
117- } catch (\React \Promise \Timer \TimeoutException $ e ) {
118- $ this ->markTestIncomplete ('Unhandled race condition, please retry ' );
119- }
115+ $ message = $ this ->awaitMessage ($ client );
120116 $ this ->assertEquals ('SessionInit ' , $ message ->MsgType );
121117
122118 return $ message ;
@@ -290,11 +286,15 @@ public function testCreateClientWithInvalidAuthUrlRejects()
290286
291287 private function awaitMessage (Client $ client )
292288 {
293- return Block \await (new Promise (function ($ resolve , $ reject ) use ($ client ) {
294- $ client ->once ('data ' , $ resolve );
289+ try {
290+ return Block \await (new Promise (function ($ resolve , $ reject ) use ($ client ) {
291+ $ client ->once ('data ' , $ resolve );
295292
296- $ client ->once ('error ' , $ reject );
297- $ client ->once ('close ' , $ reject );
298- }), Loop::get (), 10.0 );
293+ $ client ->once ('error ' , $ reject );
294+ $ client ->once ('close ' , $ reject );
295+ }), Loop::get (), 10.0 );
296+ } catch (\React \Promise \Timer \TimeoutException $ e ) {
297+ $ this ->markTestIncomplete ('Unhandled race condition, please retry ' );
298+ }
299299 }
300300}
0 commit comments