Ensure consistend order for tasks with equal timestamp (fixes flaky test)

[MAILPOET-2623]
This commit is contained in:
Jan Jakeš
2020-01-23 09:55:48 +01:00
committed by Jack Kitterhing
parent 2e7609fca0
commit de9c151fe4

View File

@@ -51,6 +51,7 @@ class State
$tasks = [];
foreach ($statuses as $status) {
$query = ScheduledTask::orderByDesc('created_at')
->orderByAsc('id') // consistent order for tasks with equal timestamps
->whereNull('deleted_at')
->limit($limit);
if ($type) {