From: Joe Watkins Date: Sun, 16 Jun 2019 05:02:28 +0000 (+0200) Subject: gettimeofday cannot be used to reliably implement high precision process synchronization X-Git-Tag: php-7.4.0alpha2~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e1972796b1706a668643830f3e5aa9960a85a70;p=php gettimeofday cannot be used to reliably implement high precision process synchronization The use of gettimeofday in time_sleep_until is technically incorrect, it's not possible to use gettimeofday in this way reliably on any platform: It relies on operating system global structures, which may be modified by any other process on the system at any time. While in practice, users may be ignoring this flaw, it entirely depends on the other software running on the system to which the application is deployed, there is no possible way to write a test that will always pass on any system, therefore it must be marked XFAIL. --- diff --git a/ext/standard/tests/misc/time_sleep_until_basic.phpt b/ext/standard/tests/misc/time_sleep_until_basic.phpt index cac7133e95..7f35677d1e 100644 --- a/ext/standard/tests/misc/time_sleep_until_basic.phpt +++ b/ext/standard/tests/misc/time_sleep_until_basic.phpt @@ -32,3 +32,5 @@ Michele Orselli mo@ideato.it --EXPECT-- bool(true) bool(true) +--XFAIL-- +gettimeofday cannot be used to reliably implement high precision process synchronization