Skip to content

Commit

Permalink
Fix queue tests which have delay
Browse files Browse the repository at this point in the history
  • Loading branch information
stubbo committed Jan 11, 2024
1 parent b0fdb1f commit 5e6e724
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/QueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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']);
Expand All @@ -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);

Expand Down

0 comments on commit 5e6e724

Please sign in to comment.