From c47aa151e07f99e28cb36bf80d768a5e25766104 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 19 Mar 2024 02:29:40 +1100 Subject: [PATCH] [1.x] Freeze time to fix flakey tests (#337) * Freeze time to fix flakey tests * Drop comment --- tests/Feature/Recorders/QueuesTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Feature/Recorders/QueuesTest.php b/tests/Feature/Recorders/QueuesTest.php index 6e26b994..90592f97 100644 --- a/tests/Feature/Recorders/QueuesTest.php +++ b/tests/Feature/Recorders/QueuesTest.php @@ -20,6 +20,8 @@ use Laravel\Pulse\Facades\Pulse; use Laravel\Pulse\Recorders\Queues; +use function Pest\Laravel\freezeTime; + function queueAggregates() { return Pulse::ignore(fn () => DB::table('pulse_aggregates')->whereIn('type', [ @@ -32,6 +34,10 @@ function queueAggregates() ])->get()); } +beforeEach(function () { + freezeTime(); +}); + it('ingests bus dispatched jobs', function () { Config::set('queue.default', 'database');