diff --git a/.travis.yml b/.travis.yml index 9cd7032..5fd9922 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4 - hhvm # ignore errors, see below # lock distro so new future defaults will not break the build @@ -25,4 +26,5 @@ install: - composer install --no-interaction script: - - vendor/bin/phpunit --coverage-text + - ./vendor/bin/phpunit -v + - ./vendor/bin/phpunit -v --coverage-text --coverage-clover=./build/logs/clover.xml diff --git a/composer.json b/composer.json index 1fdaddd..cfe99ee 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,6 @@ "react/promise": "^2.7.0 || ^1.2.1" }, "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35" } } diff --git a/tests/FunctionRejectTest.php b/tests/FunctionRejectTest.php index dbbff3d..30d42de 100644 --- a/tests/FunctionRejectTest.php +++ b/tests/FunctionRejectTest.php @@ -53,6 +53,10 @@ public function testWaitingForPromiseToRejectDoesNotLeaveGarbageCycles() $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = Timer\reject(0.01, $this->loop); @@ -68,6 +72,10 @@ public function testCancellingPromiseDoesNotLeaveGarbageCycles() $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = Timer\reject(0.01, $this->loop); diff --git a/tests/FunctionResolveTest.php b/tests/FunctionResolveTest.php index c4e2be7..155e82b 100644 --- a/tests/FunctionResolveTest.php +++ b/tests/FunctionResolveTest.php @@ -75,6 +75,10 @@ public function testWaitingForPromiseToResolveDoesNotLeaveGarbageCycles() $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = Timer\resolve(0.01, $this->loop); @@ -90,6 +94,10 @@ public function testCancellingPromiseDoesNotLeaveGarbageCycles() $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = Timer\resolve(0.01, $this->loop); diff --git a/tests/FunctionTimeoutTest.php b/tests/FunctionTimeoutTest.php index 9652d1a..0c7378d 100644 --- a/tests/FunctionTimeoutTest.php +++ b/tests/FunctionTimeoutTest.php @@ -176,6 +176,10 @@ public function testWaitingForPromiseToResolveBeforeTimeoutDoesNotLeaveGarbageCy $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = Timer\resolve(0.01, $this->loop); @@ -194,6 +198,10 @@ public function testWaitingForPromiseToRejectBeforeTimeoutDoesNotLeaveGarbageCyc $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = Timer\reject(0.01, $this->loop); @@ -212,6 +220,10 @@ public function testWaitingForPromiseToTimeoutDoesNotLeaveGarbageCycles() $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = new \React\Promise\Promise(function () { }, function () { @@ -232,6 +244,10 @@ public function testWaitingForPromiseToTimeoutWithoutCancellerDoesNotLeaveGarbag $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = new \React\Promise\Promise(function () { }); @@ -250,6 +266,10 @@ public function testWaitingForPromiseToTimeoutWithNoOpCancellerDoesNotLeaveGarba $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = new \React\Promise\Promise(function () { }, function () { @@ -270,6 +290,10 @@ public function testCancellingPromiseDoesNotLeaveGarbageCycles() $this->markTestSkipped('Not supported on legacy Promise v1 API'); } + if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) { + $this->markTestSkipped('This test has memory leaks when code coverage is collected'); + } + gc_collect_cycles(); $promise = new \React\Promise\Promise(function () { }, function () {