Skip to content

Commit

Permalink
Add sleep timer before enqueuing tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Strift committed Dec 27, 2024
1 parent 40876bc commit 32483ae
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/Endpoints/TasksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,28 @@ public function testGetAllTasksInReverseOrder(): void
{
$startDate = new \DateTimeImmutable('now');
[$promise] = $this->seedIndex();
$this->client->waitForTask($promise['taskUid']);
[$promise2] = $this->seedIndex();
sleep(1);
$endDate = new \DateTimeImmutable('now');

$this->client->waitForTask($promise['taskUid']);
$this->client->waitForTask($promise2['taskUid']);

$tasks = $this->client->getTasks((new TasksQuery())
->setAfterEnqueuedAt($startDate)
->setBeforeEnqueuedAt($endDate)
);
$reversedTasks = $this->client->getTasks((new TasksQuery())
->setAfterEnqueuedAt($startDate)
->setBeforeEnqueuedAt($endDate)
->setReverse(true)
);

print_r($startDate);
print_r($endDate);
print_r($tasks->getResults());
print_r($reversedTasks->getResults());

self::assertSameSize($tasks->getResults(), $reversedTasks->getResults());
self::assertSame($tasks->getResults(), array_reverse($reversedTasks->getResults()));
}
Expand Down

0 comments on commit 32483ae

Please sign in to comment.