8000 StreamSelectLoop: Int overflow for big timer intervals by ivkalita · Pull Request #95 · reactphp/event-loop · GitHub
[go: up one dir, main page]

Skip to content

StreamSelectLoop: Int overflow for big timer intervals #95

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
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix StreamSelectLoopTest::testSmallTimerInterval to expect nanoseconds.
  • Loading branch information
ivkalita committed Apr 5, 2017
commit 61a7f8495796d895b6be77b6c8874df2961e377c
10 changes: 5 additions & 5 deletions tests/StreamSelectLoopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ protected function forkSendSignal($signal)
public function testSmallTimerInterval()
{
/** @var StreamSelectLoop|\PHPUnit_Framework_MockObject_MockObject $loop */
$loop = $this->getMock('React\EventLoop\StreamSelectLoop', ['streamSelect']);
$loop = $this->getMock('React\EventLoop\StreamSelectLoop', ['sleep']);
$loop
->expects($this->at(0))
->method('streamSelect')
->with([], [], 1);
->method('sleep')
->with(0, intval(Timer::MIN_INTERVAL * StreamSelectLoop::NANOSECONDS_PER_SECOND));
$loop
->expects($this->at(1))
->method('streamSelect')
->with([], [], 0);
->method('sleep')
->with(0, 0);

$callsCount = 0;
$loop->addPeriodicTimer(Timer::MIN_INTERVAL, function() use (&$loop, &$callsCount) {
Expand Down
0