-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix failing tests #85
Comments
Also, all signal tests are skipped for me right now. |
Signal tests have been fixed, all timer tests have a grace period of 1 millisecond now, but the |
So the issue with this is delaying from what I can tell. I've written a shorter test that's a little easier to follow and displays the issue more clearly: public function testExecutionOrder()
{
// Our expected output
$this->expectOutputString('defer writable reenabled delay ');
// Set up a closure to output
$output = function(Driver $loop, string $output) {
$called = false;
// Return a function that tracks whether it has been called
return function($id) use ($loop, $output, &$called) {
if ($called) {
$this->fail('Watcher callback called too often');
}
$called = true;
$loop->cancel($id);
echo $output . ' ';
};
};
// Begin a loop for testing
$this->start(function (Driver $loop) use (&$ticks, $output) {
// Lets start with the reenabled watcher
$reenabled = $loop->onWritable(STDIN, $output($loop, 'reenabled'));
$loop->disable($reenabled);
// Lets defer something now
$loop->defer($output($loop, 'defer'));
// Move on to delay
$loop->delay(0, $output($loop, 'delay'));
// Writable
$loop->onWritable(STDIN, $output($loop, 'writable'));
// Reenable
$loop->enable($reenabled);
});
} Adding this to the
Which tells me that UV's timer functionality is perhaps acting unexpectedly with low millisecond delays. I threw the whole of the handling code for delay in a Is there a good spot where I could talk to someone who maybe knows more about this than I do? |
Actually, we do not guarantee timer and IO watcher order according to Line 55 in 95b3f62
|
Well, perhaps we should redo the test in a way that allows for that and makes it clear that that may happen. Let me see if I can come up with anything today and I'll submit a PR. |
The test totally needs a redo, it's horrible. Thanks for looking into that. 👍 |
Test results when running locally with PHP 7.1.3RC1 and
uv
andevent
extensions.The text was updated successfully, but these errors were encountered: