From 62caf9fefc062a9edf9a81020e9c7dab2219cc38 Mon Sep 17 00:00:00 2001 From: Aleksey Shakhmatov Date: Tue, 4 Aug 2026 08:55:55 +0300 Subject: [PATCH] tests/fuzz: tighten the listIndexes NamespaceNotFound comment Comment-only cleanup: the six-line rationale restated the scenario twice (first-cycle crash at prefix 0 = kill during the first in-flight command on a fresh log) and echoed 'expected state' with 'exactly the case worth verifying'. Four lines keep all three points: real MongoDB answers NamespaceNotFound too, it is expected when nothing durable created the collection, and treating it as a harness error broke verification of that case. --- tests/fuzz/crash-fuzz.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/fuzz/crash-fuzz.js b/tests/fuzz/crash-fuzz.js index 7c27d68..50cfdca 100644 --- a/tests/fuzz/crash-fuzz.js +++ b/tests/fuzz/crash-fuzz.js @@ -498,12 +498,10 @@ async function verify(client, base, r, cycleNo) { const coll = db.collection('c'); const dbDocs = await coll.find({}, { sort: { _id: 1 } }).toArray(); const dbMap = new Map(dbDocs.map((d) => [d._id, d])); - // `listIndexes` on a namespace that does not exist is NamespaceNotFound, which - // is what real MongoDB answers too -- and it is the *expected* state whenever - // the surviving prefix contains no write that created the collection (a kill - // during the first in-flight command on a fresh log). Treating it as a harness - // error made any seed whose first cycle crashed at prefix 0 abort the run - // instead of verifying it, which is exactly the case worth verifying. + // listIndexes on a nonexistent namespace answers NamespaceNotFound, as real + // MongoDB does too -- the expected state when a kill lands during the first + // in-flight command on a fresh log. Treating it as a harness error made seeds + // that crashed at prefix 0 abort instead of verifying. const dbIndexes = await coll.indexes().catch((e) => { if (e.code === 26 || /ns not found|NamespaceNotFound/i.test(e.message)) return []; throw e;