diff --git a/moto/batch/models.py b/moto/batch/models.py index 8e98db457..09ba0f9f1 100644 --- a/moto/batch/models.py +++ b/moto/batch/models.py @@ -618,6 +618,7 @@ class Job(threading.Thread, BaseModel, DockerModel): ) date = unix_time_millis(date_obj) logs.append({"timestamp": date, "message": line.strip()}) + logs = sorted(logs, key=lambda l: l["timestamp"]) # Send to cloudwatch log_group = "/aws/batch/job"