From 5e6e724229109780c63d7dc73fd12cce746a43c7 Mon Sep 17 00:00:00 2001 From: stubbo Date: Thu, 11 Jan 2024 17:22:33 +0000 Subject: [PATCH] Fix queue tests which have delay --- tests/QueueTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/QueueTest.php b/tests/QueueTest.php index c23e711ab..f5cd0c0ff 100644 --- a/tests/QueueTest.php +++ b/tests/QueueTest.php @@ -149,7 +149,7 @@ public function testQueueRelease(): void { Carbon::setTestNow(); $queue = 'test'; - $delay = 123; + $delay = now()->addSeconds(123); Queue::push($queue, ['action' => 'QueueRelease'], 'test'); $job = Queue::pop($queue); @@ -164,7 +164,7 @@ public function testQueueRelease(): void $this->assertEquals(1, $releasedJob['attempts']); $this->assertNull($releasedJob['reserved_at']); $this->assertEquals( - Carbon::now()->addRealSeconds($delay)->getTimestamp(), + $delay->getTimestamp(), $releasedJob['available_at'], ); $this->assertEquals(Carbon::now()->getTimestamp(), $releasedJob['created_at']); @@ -174,7 +174,7 @@ public function testQueueRelease(): void public function testQueueDeleteAndRelease(): void { $queue = 'test'; - $delay = 123; + $delay = now()->addSeconds(123); Queue::push($queue, ['action' => 'QueueDeleteAndRelease'], 'test'); $job = Queue::pop($queue);