From 42a0958322c285f1ab63fc1cb7a9cc36c732c4ea Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 12 May 2026 20:03:54 -0400 Subject: [PATCH] test: Fix flaky comments.list ordering assertion (#12329) Two comments built back-to-back could share a millisecond-precision createdAt, leaving the DESC-ordered result non-deterministic. Pass explicit createdAt values so the assertion on body.data[1] is stable. --- server/routes/api/comments/comments.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/routes/api/comments/comments.test.ts b/server/routes/api/comments/comments.test.ts index 18082c80a0..692cb17b76 100644 --- a/server/routes/api/comments/comments.test.ts +++ b/server/routes/api/comments/comments.test.ts @@ -187,10 +187,12 @@ describe("#comments.list", () => { const comment = await buildComment({ userId: user.id, documentId: document.id, + createdAt: new Date(Date.now() - 1000), }); await buildResolvedComment(user, { userId: user.id, documentId: document.id, + createdAt: new Date(), }); const res = await server.post("/api/comments.list", { body: {