Skip to content

Commit

Permalink
[1.x] Freeze time to fix flakey tests (#337)
Browse files Browse the repository at this point in the history
* Freeze time to fix flakey tests

* Drop comment
  • Loading branch information
timacdonald authored Mar 18, 2024
1 parent 94e9c58 commit c47aa15
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Feature/Recorders/QueuesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand All @@ -32,6 +34,10 @@ function queueAggregates()
])->get());
}

beforeEach(function () {
freezeTime();
});

it('ingests bus dispatched jobs', function () {
Config::set('queue.default', 'database');

Expand Down

0 comments on commit c47aa15

Please sign in to comment.