From 79c8db2cb71a7fc2f1aa9644f62d0e53cf3a144c Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Thu, 28 May 2026 19:41:42 +0200 Subject: [PATCH] fix(e2e): non-mutating reverse in CleanupRegistry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Array.reverse mutates in place — a defensive double-run() would have re-reversed the items. Iterate over a copy. Co-Authored-By: Claude Opus 4.7 (1M context) --- dashboard/tests/e2e/fixtures/cleanup.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard/tests/e2e/fixtures/cleanup.ts b/dashboard/tests/e2e/fixtures/cleanup.ts index 98bc1f7..3bca206 100644 --- a/dashboard/tests/e2e/fixtures/cleanup.ts +++ b/dashboard/tests/e2e/fixtures/cleanup.ts @@ -32,7 +32,10 @@ export class CleanupRegistry { if (this.items.length === 0) return; const api = await adminApi(); try { - for (const item of this.items.reverse()) { + // Copy-then-reverse so a defensive double-`run()` (or a + // caller that inspects the registry after a partial + // teardown) doesn't see the items in a re-reversed order. + for (const item of [...this.items].reverse()) { try { await item(api); } catch {