Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/FunctionalResolverTest.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@
use React\Dns\RecordNotFoundException;
use React\Dns\Model\Message;

class FunctionalTest extends TestCase
class FunctionalResolverTest extends TestCase
{
/**
* @before
Expand DownExpand Up@@ -171,6 +171,7 @@ public function testResolveCachedShouldNotCauseGarbageReferencesWhenUsingInvalid
$this->resolver = $factory->createCached('255.255.255.255', $this->loop);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $this->resolver->resolve('google.com');
unset($promise);
Expand All@@ -188,6 +189,7 @@ public function testCancelResolveShouldNotCauseGarbageReferences()
$this->resolver = $factory->create('127.0.0.1', $this->loop);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $this->resolver->resolve('google.com');
$promise->cancel();
Expand All@@ -206,6 +208,7 @@ public function testCancelResolveCachedShouldNotCauseGarbageReferences()
$this->resolver = $factory->createCached('127.0.0.1', $this->loop);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $this->resolver->resolve('google.com');
$promise->cancel();
Expand Down
1 change: 1 addition & 0 deletions tests/Query/CoopExecutorTest.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -221,6 +221,7 @@ public function testCancelQueryShouldNotCauseGarbageReferences()
$connector = new CoopExecutor($base);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$query = new Query('reactphp.org', Message::TYPE_A, Message::CLASS_IN);

Expand Down
6 changes: 6 additions & 0 deletions tests/Query/RetryExecutorTest.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -251,6 +251,8 @@ public function queryShouldNotCauseGarbageReferencesOnTimeoutErrors()
$retryExecutor = new RetryExecutor($executor, 0);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN);
$retryExecutor->query($query);

Expand DownExpand Up@@ -281,6 +283,8 @@ public function queryShouldNotCauseGarbageReferencesOnCancellation()
$retryExecutor = new RetryExecutor($executor, 0);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN);
$promise = $retryExecutor->query($query);
$promise->cancel();
Expand DownExpand Up@@ -311,6 +315,8 @@ public function queryShouldNotCauseGarbageReferencesOnNonTimeoutErrors()
$retryExecutor = new RetryExecutor($executor, 2);

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN);
$retryExecutor->query($query);

Expand Down
6 changes: 6 additions & 0 deletions tests/Query/SelectiveTransportExecutorTest.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,6 +159,8 @@ public function testCancelPromiseShouldNotCreateAnyGarbageReferences()
}));

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $this->executor->query($query);
$promise->cancel();
unset($promise);
Expand DownExpand Up@@ -190,6 +192,8 @@ public function testCancelPromiseAfterTruncatedResponseShouldNotCreateAnyGarbage
}));

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $this->executor->query($query);
$deferred->reject(new \RuntimeException('', defined('SOCKET_EMSGSIZE') ? SOCKET_EMSGSIZE : 90));
$promise->cancel();
Expand All@@ -215,6 +219,8 @@ public function testRejectedPromiseAfterTruncatedResponseShouldNotCreateAnyGarba
->willReturn(\React\Promise\reject(new \RuntimeException()));

gc_collect_cycles();
gc_collect_cycles(); // clear twice to avoid leftovers in PHP 7.4 with ext-xdebug and code coverage turned on

$promise = $this->executor->query($query);
unset($promise);

Expand Down