1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-30 04:19:23 +01:00

Update test

This commit is contained in:
Aaron Piotrowski 2018-04-03 12:23:39 -05:00
parent 33a74dfecd
commit 5ba0469d7a
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -4,6 +4,7 @@ namespace Amp\ByteStream\Test;
use Amp\ByteStream\ResourceOutputStream;
use Amp\ByteStream\StreamException;
use Amp\Delayed;
use PHPUnit\Framework\TestCase;
use function Amp\Promise\wait;
@ -70,7 +71,7 @@ class ResourceOutputStreamTest extends TestCase {
// Creates a fork without having to deal with it…
// The fork inherits the FDs of the current process.
$proc = \proc_open("sleep 3", [
$proc = \proc_open("sleep 1", [
['pipe', 'r'],
['pipe', 'w'],
['pipe', 'w'],
@ -83,6 +84,8 @@ class ResourceOutputStreamTest extends TestCase {
$this->expectException(StreamException::class);
$this->expectExceptionMessage("Failed to write to stream; fwrite():");
wait(new Delayed(2000));
try {
// The first write still succeeds somehow...
wait($stream->write("foobar"));