Skip to content

StreamSelectLoop: Int overflow for big timer intervals #96

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

Closed
Prev Previous commit
Next Next commit
Add StreamSelectLoop test for PHP_INT_MAX seconds timer interval.
  • Loading branch information
ivkalita committed Apr 5, 2017
commit 08c709b260faefe374d435c6db64c12bb772d0ab
19 changes: 19 additions & 0 deletions tests/StreamSelectLoopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,23 @@ public function testSmallTimerInterval()

$loop->run();
}

/**
* https://github.com/reactphp/event-loop/issues/19
*
* Tests that timer with PHP_INT_MAX seconds interval will work.
*/
public function testIntOverflowTimerInterval()
{
/** @var StreamSelectLoop|\PHPUnit_Framework_MockObject_MockObject $loop */
$loop = $this->getMock('React\EventLoop\StreamSelectLoop', ['sleep']);
$loop->expects($this->once())
->method('sleep')
->with(PHP_INT_MAX, 0)
->willReturnCallback(function() use (&$loop) {
$loop->stop();
});
$loop->addTimer(PHP_INT_MAX, function(){});
$loop->run();
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy