10000 Broaden timer tests limits · tamirvs/symfony@005d86f · GitHub
[go: up one dir, main page]

Skip to content

Commit 005d86f

Browse files
committed
Broaden timer tests limits
1 parent 001c4fd commit 005d86f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/Symfony/Tests/Component/HttpKernel/Debug/StopwatchEventTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public function testTotalTime()
6666
{
6767
$event = new StopwatchEvent(microtime(true) * 1000);
6868
$event->start();
69-
usleep(10000);
69+
usleep(20000);
7070
$event->stop();
7171
$total = $event->getTotalTime();
72-
$this->assertTrue($total >= 9 && $total <= 20);
72+
$this->assertTrue($total > 10 && $total <= 29, $total.' should be 20 (between 10 and 29)');
7373

7474
$event = new StopwatchEvent(microtime(true) * 1000);
7575
$event->start();
@@ -79,7 +79,7 @@ public function testTotalTime()
7979
usleep(10000);
8080
$event->stop();
8181
$total = $event->getTotalTime();
82-
$this->assertTrue($total >= 18 && $total <= 30);
82+
$this->assertTrue($total > 10 && $total <= 29, $total.' should be 20 (between 10 and 29)');
8383
}
8484

8585
/**
@@ -101,7 +101,7 @@ public function testEnsureStopped()
101101
usleep(10000);
102102
$event->ensureStopped();
103103
$total = $event->getTotalTime();
104-
$this->assertTrue($total >= 27 && $total <= 40);
104+
$this->assertTrue($total >= 21 && $total <= 39, $total.' should be 30 (between 21 and 39)');
105105
}
106106

107107
public function testStartTime()
@@ -139,7 +139,7 @@ public function testEndTime()
139139
usleep(10000);
140140
$event->stop();
141141
$end = $event->getEndTime();
142-
$this->assertTrue($end >= 18 && $end <= 30);
142+
$this->assertTrue($end > 10 && $end <= 29, $end.' should be 20 (between 10 and 29)');
143143
}
144144

145145
/**

tests/Symfony/Tests/Component/HttpKernel/Debug/StopwatchTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public function testStop()
3333
{
3434
$stopwatch = new Stopwatch();
3535
$stopwatch->start('foo', 'cat');
36-
usleep(10000);
36+
usleep(20000);
3737
$event = $stopwatch->stop('foo');
3838

3939
$this->assertInstanceof('Symfony\Component\HttpKernel\Debug\StopwatchEvent', $event);
4040
$total = $event->getTotalTime();
41-
$this->assertTrue($total >= 9 && $total <= 20);
41+
$this->assertTrue($total > 10 && $total <= 29, $total.' should be 20 (between 10 and 29)');
4242
}
4343

4444
public function testLap()
@@ -52,7 +52,7 @@ public function testLap()
5252

5353
$this->assertInstanceof('Symfony\Component\HttpKernel\Debug\StopwatchEvent', $event);
5454
$total = $event->getTotalTime();
55-
$this->assertTrue($total >= 18 && $total <= 30);
55+
$this->assertTrue($total > 10 && $total <= 29, $total.' should be 20 (between 10 and 29)');
5656
}
5757

5858
/**

0 commit comments

Comments
 (0)
0