Skip to content

Commit

Permalink
Fix ResourceOutputStreamTest on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Apr 13, 2024
1 parent 7ab614c commit 118a296
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/ResourceOutputStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Amp\ByteStream\ResourceOutputStream;
use Amp\ByteStream\StreamException;
use Amp\PHPUnit\AsyncTestCase;
use function Amp\delay;
use const PHP_OS;

class ResourceOutputStreamTest extends AsyncTestCase
Expand Down Expand Up @@ -72,8 +73,9 @@ public function testClosedRemoteSocket(): ?\Generator
$this->expectException(StreamException::class);
$this->expectExceptionMessage(/* S|s */ "end of 6 bytes failed with errno=" . (\stripos(PHP_OS, "win") === 0 ? "10053" : "32 Broken pipe"));

// The first write still succeeds somehow...
yield $stream->write("foobar");
// There's some delay until a write fails on macOS (and possibly other OSes)
yield delay(100);
yield $stream->write("foobar");
}
}

0 comments on commit 118a296

Please sign in to comment.