dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
51eba19
)
Stop test from randomly failing
author
Aryeh Gregor
<ayg@aryeh.name>
Mon, 26 Mar 2018 17:08:22 +0000
(20:08 +0300)
committer
Aryeh Gregor
<ayg@aryeh.name>
Mon, 26 Mar 2018 17:08:22 +0000
(20:08 +0300)
The difference between two integers is less than 1 only if it's 0, so
the test as-is will fail whenever the second changes between when '1
day' is evaluated when inserting the block, and when time() is called
for the assert.
Change-Id: Ic76ff05729129b74345696879a934253525213fa
tests/phpunit/includes/api/ApiBlockTest.php
patch
|
blob
|
history
diff --git
a/tests/phpunit/includes/api/ApiBlockTest.php
b/tests/phpunit/includes/api/ApiBlockTest.php
index
c0cf87e
..
c456e9a
100644
(file)
--- a/
tests/phpunit/includes/api/ApiBlockTest.php
+++ b/
tests/phpunit/includes/api/ApiBlockTest.php
@@
-207,7
+207,7
@@
class ApiBlockTest extends ApiTestCase {
);
// Allow flakiness up to one second
- $this->assertLessThan( 1,
+ $this->assertLessThan
OrEqual
( 1,
abs( wfTimestamp( TS_UNIX, $expiry ) - ( time() + 86400 ) ) );
}