diff --git a/.travis.yml b/.travis.yml index bd2ae443..ddac7a86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4 - nightly # ignore errors, see below # lock distro so new future defaults will not break the build @@ -17,6 +18,7 @@ install: - composer install script: + - ./vendor/bin/phpunit -v - ./vendor/bin/phpunit -v --coverage-text --coverage-clover=./build/logs/clover.xml after_script: diff --git a/tests/DeferredTest.php b/tests/DeferredTest.php index 172cb246..861dd576 100644 --- a/tests/DeferredTest.php +++ b/tests/DeferredTest.php @@ -23,6 +23,10 @@ public function getPromiseTestAdapter(callable $canceller = null) /** @test */ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerRejectsWithException() { + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $deferred = new Deferred(function ($resolve, $reject) { $reject(new \Exception('foo')); @@ -36,6 +40,10 @@ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerRejectsWithEx /** @test */ public function shouldRejectWithoutCreatingGarbageCyclesIfParentCancellerRejectsWithException() { + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $deferred = new Deferred(function ($resolve, $reject) { $reject(new \Exception('foo')); @@ -49,6 +57,10 @@ public function shouldRejectWithoutCreatingGarbageCyclesIfParentCancellerRejects /** @test */ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerHoldsReferenceAndExplicitlyRejectWithException() { + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $deferred = new Deferred(function () use (&$deferred) { }); $deferred->reject(new \Exception('foo'));