diff --git a/tests/Query/TcpTransportExecutorTest.php b/tests/Query/TcpTransportExecutorTest.php index eae4d2c4..21583077 100644 --- a/tests/Query/TcpTransportExecutorTest.php +++ b/tests/Query/TcpTransportExecutorTest.php @@ -247,10 +247,6 @@ function ($e) use (&$wait) { public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneChunkWhenServerClosesSocket() { - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Not supported on HHVM'); - } - $writableCallback = null; $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addWriteStream')->with($this->anything(), $this->callback(function ($cb) use (&$writableCallback) { @@ -268,7 +264,10 @@ public function testQueryStaysPendingWhenClientCanNotSendExcessiveMessageInOneCh $query = new Query('google' . str_repeat('.com', 10000), Message::TYPE_A, Message::CLASS_IN); - $promise = $executor->query($query); + // send a bunch of queries and keep reference to last promise + for ($i = 0; $i < 100; ++$i) { + $promise = $executor->query($query); + } $client = stream_socket_accept($server); fclose($client); @@ -571,11 +570,7 @@ public function testQueryRejectsIfSocketIsClosedAfterPreviousQueryThatWasStillPe $executor->handleWritable(); - // manually close socket before processing second write - $ref = new \ReflectionProperty($executor, 'socket'); - $ref->setAccessible(true); - $socket = $ref->getValue($executor); - fclose($socket); + // close client socket before processing second write fclose($client); $promise2 = $executor->query($query);