Fix latenten Flake in links.service.db.test (Phantom-Sortierung)
All checks were successful
CI / Lint, typecheck, test (pull_request) Successful in 4m24s
CI / Build container images (pull_request) Successful in 3m45s
CI / Auth e2e pack (pull_request) Successful in 6m48s
CI / Import/export fidelity gate (pull_request) Successful in 50s
CI / Lint, typecheck, test (push) Successful in 4m31s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 6m45s
CI / Import/export fidelity gate (push) Successful in 54s
CD / Build and push images (push) Successful in 16s
CD / Deploy to Test (push) Successful in 9s
CD / Smoke tests against Test (push) Successful in 1m16s
CD / Promote to Int (push) Successful in 11s

pondGraph-Test sortierte die EMPFANGENEN Phantom-Slugs, verglich aber
gegen ein UNsortiertes Literal. Da beide Slugs (ghost-<sfx>,
ghost-secret-<sfx>) den Zufalls-Suffix teilen, kippt ihre Sortierreihen-
folge auf ~1/5 der Suffixe (wenn sfx[0] > 's') → nicht-deterministischer
Fehlschlag. In CI-Lauf 372 traf es zu (Suffix „vpxwe…"). Fix: beide
Seiten sortieren. Vorbestehender Bug, unabhängig von M17–M19.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155v2aT8AG1kZDQEZiCLBWC
This commit is contained in:
Claude Fable 5 2026-07-19 06:12:55 +02:00
parent d5b895ada2
commit 5255cdce06

View File

@ -277,10 +277,12 @@ describe.skipIf(!hasTestDb)('LinksService.pondGraph (db, issue #111)', () => {
{ from: a, to: secret }, { from: a, to: secret },
].sort((x, y) => x.to.localeCompare(y.to)), ].sort((x, y) => x.to.localeCompare(y.to)),
); );
expect(graph.phantoms.map((p) => p.targetSlug).sort()).toEqual([ // Sort BOTH sides: phantom order is not guaranteed, and the two slugs share
`ghost-${suffix}`, // the random suffix so their sort order flips on ~1/5 of suffixes (the
`ghost-secret-${suffix}`, // expected array was previously left unsorted — a latent flake).
]); expect(graph.phantoms.map((p) => p.targetSlug).sort()).toEqual(
[`ghost-${suffix}`, `ghost-secret-${suffix}`].sort(),
);
}); });
it('slices every collection to the reader — no hidden page leaks anywhere', async () => { it('slices every collection to the reader — no hidden page leaks anywhere', async () => {