Skip to content

Commit

Permalink
Prevent SIGPIPE test aborts with phpdbg
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Jul 15, 2017
1 parent 666ece1 commit 6b9074f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/ResourceStreamTest.php
Expand Up @@ -62,6 +62,10 @@ public function testThrowsOnExternallyShutdownStreamWithLargePayload() {
$this->expectException(StreamException::class);

Loop::run(function () {
try { /* prevent crashes with phpdbg due to SIGPIPE not being handled... */
Loop::onSignal(defined("SIGPIPE") ? SIGPIPE : 13, function () {});
} catch (Loop\UnsupportedFeatureException $e) {}

list($a, $b) = $this->getStreamPair();

$message = \str_repeat(".", self::LARGE_MESSAGE_SIZE);
Expand All @@ -79,6 +83,10 @@ public function testThrowsOnExternallyShutdownStreamWithSmallPayloads() {
$this->expectException(StreamException::class);

Loop::run(function () {
try { /* prevent crashes with phpdbg due to SIGPIPE not being handled... */
Loop::onSignal(defined("SIGPIPE") ? SIGPIPE : 13, function () {});
} catch (Loop\UnsupportedFeatureException $e) {}

list($a, $b) = $this->getStreamPair();

$message = \str_repeat(".", 8192 /* default chunk size */);
Expand Down

0 comments on commit 6b9074f

Please sign in to comment.