mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Make test more robust
Time flies, so obviously the reported uptime may differ a bit (as already occasionally noticed on CI); we cater to that by allowing a delay of up to one second.
This commit is contained in:
parent
451314111b
commit
00c9c480eb
1 changed files with 5 additions and 2 deletions
|
@ -40,8 +40,11 @@ $db = MySQLPDOTest::factory();
|
||||||
if (!preg_match('/Uptime/i', $info))
|
if (!preg_match('/Uptime/i', $info))
|
||||||
printf("[006] Can't find uptime in server info '%s'\n", $info);
|
printf("[006] Can't find uptime in server info '%s'\n", $info);
|
||||||
|
|
||||||
if (isset($uptime) && !preg_match(sprintf('/Uptime: %d/i', $uptime), $info))
|
if (isset($uptime)) {
|
||||||
|
if (!preg_match('/Uptime: (\d+)/i', $info, $matches) || $uptime - $matches[1] > 1) {
|
||||||
printf("[007] SHOW STATUS and server info have reported a different uptime, please check. Server info: '%s', SHOW STATUS: '%s'\n", $info, $uptime);
|
printf("[007] SHOW STATUS and server info have reported a different uptime, please check. Server info: '%s', SHOW STATUS: '%s'\n", $info, $uptime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "done!";
|
print "done!";
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue