From bfb8711f1d6898cd35ef57b34751f9ee1fc87b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 21 Oct 2026 16:25:25 +0200 Subject: [PATCH] test(apple-health): order the own-sample rows deterministically Rows of one type came back in insertion order only by chance, so the three-weight case failed intermittently. Sort by type, time and value. --- tests/integration/apple-health-import-own-samples.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/apple-health-import-own-samples.test.ts b/tests/integration/apple-health-import-own-samples.test.ts index e252a6fea..f90d70318 100644 --- a/tests/integration/apple-health-import-own-samples.test.ts +++ b/tests/integration/apple-health-import-own-samples.test.ts @@ -190,7 +190,7 @@ describe("blood pressure correlations and self-closing records", () => { source: "APPLE_HEALTH", type: { in: ["BLOOD_PRESSURE_SYS", "BLOOD_PRESSURE_DIA"] }, }, - orderBy: [{ type: "asc" }], + orderBy: [{ type: "asc" }, { measuredAt: "asc" }, { value: "asc" }], }); return { result, values: rows.map((r) => r.value) }; } @@ -479,7 +479,7 @@ describe("a sample whose HKExternalUUID is a HealthLog row id", () => { }); const rows = await prisma.measurement.findMany({ where: { userId: user.id, source: "APPLE_HEALTH" }, - orderBy: [{ type: "asc" }], + orderBy: [{ type: "asc" }, { measuredAt: "asc" }, { value: "asc" }], }); return { result, rows }; }