From de9c151fe4271b81da691a74cb6821bdc99b8c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jakes=CC=8C?= Date: Thu, 23 Jan 2020 09:55:48 +0100 Subject: [PATCH] Ensure consistend order for tasks with equal timestamp (fixes flaky test) [MAILPOET-2623] --- lib/Tasks/State.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Tasks/State.php b/lib/Tasks/State.php index 18a2a6a43b..d43d67360e 100644 --- a/lib/Tasks/State.php +++ b/lib/Tasks/State.php @@ -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) {