Skip to content

Commit

Permalink
Fix #1 (onSignal handlers are unordered)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi committed Oct 26, 2016
1 parent 3755a3c commit e8fb716
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit e8fb716

Please sign in to comment.