From 18183047cc28ee50b0dea168fa3a5083a6feb4d1 Mon Sep 17 00:00:00 2001 From: sumaiazaman Date: Tue, 25 Nov 2025 10:56:22 +0600 Subject: [PATCH] Fix flaky test by freezing time before write operation This prevents timing race conditions where time can advance between when the session is written (which records a timestamp) and when the expiration check occurs, causing intermittent test failures. --- tests/Session/ArraySessionHandlerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Session/ArraySessionHandlerTest.php b/tests/Session/ArraySessionHandlerTest.php index e6d29714c31e..b91c16d699c1 100644 --- a/tests/Session/ArraySessionHandlerTest.php +++ b/tests/Session/ArraySessionHandlerTest.php @@ -48,6 +48,7 @@ public function test_it_reads_data_from_an_almost_expired_session() { $handler = new ArraySessionHandler(10); + Carbon::setTestNow(Carbon::now()); $handler->write('foo', 'bar'); Carbon::setTestNow(Carbon::now()->addMinutes(10));