From e8fb7169d4a079b2ebefec6b9a9aa9e43d4b8a9d Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Wed, 26 Oct 2016 15:39:07 +0200 Subject: [PATCH] Fix #1 (onSignal handlers are unordered) --- src/Test.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Test.php b/src/Test.php index f4941f7..02f638c 100644 --- a/src/Test.php +++ b/src/Test.php @@ -577,7 +577,7 @@ function testSignalExecutionOrder() $this->markTestSkipped("ext/posix required to test signal handlers"); } - $this->expectOutputString("123456"); + $this->expectOutputString("122222"); $this->start(function(Driver $loop) { $f = function($i) use ($loop) { return function($watcherId) use ($loop, $i) { @@ -588,15 +588,15 @@ function testSignalExecutionOrder() $loop->defer($f(1)); $loop->onSignal(SIGUSR1, $f(2)); - $sig1 = $loop->onSignal(SIGUSR1, $f(4)); - $sig2 = $loop->onSignal(SIGUSR1, $f(6)); + $sig1 = $loop->onSignal(SIGUSR1, $f(2)); + $sig2 = $loop->onSignal(SIGUSR1, $f(2)); $sig3 = $loop->onSignal(SIGUSR1, $f(" FAIL - MUST NOT BE CALLED ")); $loop->disable($sig1); - $loop->onSignal(SIGUSR1, $f(3)); + $loop->onSignal(SIGUSR1, $f(2)); $loop->disable($sig2); $loop->enable($sig1); $loop->cancel($sig3); - $loop->onSignal(SIGUSR1, $f(5)); + $loop->onSignal(SIGUSR1, $f(2)); $loop->defer(function() use ($loop, $sig2) { $loop->enable($sig2); $loop->defer(function() use ($loop) {