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
Fix StreamSelectLoopTest::testSmallTimerInterval to expect nanoseconds.
  • Loading branch information
ivkalita committed Apr 5, 2017
commit 4400ede5ca298ea86c653045effb1a8bc5f6726c
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
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