From facac19a7791e5a96468c71a36d6129815221270 Mon Sep 17 00:00:00 2001 From: Go Kudo Date: Thu, 15 Aug 2024 07:36:05 +0000 Subject: [PATCH] test: fix flaky test --- ext/tests/variables/request_time_float.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/tests/variables/request_time_float.phpt b/ext/tests/variables/request_time_float.phpt index 3d92308..3cc5c74 100644 --- a/ext/tests/variables/request_time_float.phpt +++ b/ext/tests/variables/request_time_float.phpt @@ -7,7 +7,7 @@ colopl_timeshifter $before_request_time = $_SERVER['REQUEST_TIME_FLOAT']; -\Colopl\ColoplTimeShifter\register_hook(new \DateInterval('P1Y')); +\Colopl\ColoplTimeShifter\register_hook(new \DateInterval('P2Y')); $after_request_time = $_SERVER['REQUEST_TIME_FLOAT']; @@ -16,7 +16,7 @@ $after = new \DateTime('@' . $after_request_time); $interval = $after->diff($before); -if ($before == $after || $interval->y !== 1 || $interval->invert !== 0) { +if ($before == $after || $interval->y <= 0 || $interval->invert !== 0) { die('failed'); }