File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,8 @@ public function connect($uri)
159159 // either close active connection or cancel pending connection attempt
160160 $ connecting ->then (function (ConnectionInterface $ stream ) {
161161 $ stream ->close ();
162+ }, function () {
163+ // ignore to avoid reporting unhandled rejection
162164 });
163165 $ connecting ->cancel ();
164166 });
Original file line number Diff line number Diff line change @@ -542,6 +542,9 @@ public function testRejectedConnectionShouldNotCreateGarbageCycles()
542542 $ proxy = new ProxyConnector ('proxy.example.com ' , $ this ->connector );
543543
544544 $ promise = $ proxy ->connect ('google.com:80 ' );
545+
546+ $ promise ->then (null , $ this ->expectCallableOnce ()); // avoid reporting unhandled rejection
547+
545548 unset($ promise );
546549
547550 $ this ->assertEquals (0 , gc_collect_cycles ());
You can’t perform that action at this time.
0 commit comments