Skip to content

Commit 1d71fb0

Browse files
author
Eugene Leonovich
committed
Update ttl tests to work correctly with delays
It's not guaranteed that a task state will be updated immediately after the delay has expired
1 parent ea03a9d commit 1d71fb0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Integration/Ttl.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function testDelay()
6666

6767
sleep(1);
6868

69-
$task = $this->queue->peek(0);
70-
$this->assertTask($task, 0, States::READY, 'delay_1');
69+
$task = $this->queue->take(.1);
70+
$this->assertTask($task, 0, States::TAKEN, 'delay_1');
7171
}
7272

7373
/**
@@ -83,8 +83,8 @@ public function testDelayedRelease()
8383

8484
sleep(1);
8585

86-
$task = $this->queue->peek(0);
87-
$this->assertTask($task, 0, States::READY, 'release_0');
86+
$task = $this->queue->take(.1);
87+
$this->assertTask($task, 0, States::TAKEN, 'release_0');
8888
}
8989

9090
/**

0 commit comments

Comments
 (0)