Skip to content

Commit 4567741

Browse files
codeslakeclaude
andcommitted
fix(test): drop the duplicate classify() guard and test the cnighswonger#356 merge left behind
conflict-shape.sh's additive resolution on the cnighswonger#356 merge kept both sides of two hunks where cnighswonger#356 (cut from upstream, before cnighswonger#345 or cnighswonger#355 existed) independently re-added content cnighswonger#345 had already added on this branch: a second `if (typeof body !== "string") return null;` guard (with its own, now-superseded comment) stacked dead beneath the one already in classify(), and a second, byte-identical copy of the "classify survives a probe that answers with a status code" test right after it. Both were textually different insertions at the same conflict hunk (so "additive" concatenated them) but semantically the same content twice. Neither duplicate changed behaviour -- the second guard clause is unreachable, and node:test does not refuse a duplicate case name -- so the suite passed either way; kept once, as the recorded resolution for this file already documents keeping ours' guard. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFPGPPSYmx8NNGqbEsSpNc Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 12d17d4 commit 4567741

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

test/proxy-held-port.test.mjs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ function classify(body) {
5353
// because this is a shared helper with a history of differently shaped probes,
5454
// and the answer to one is "that was a reply, not an outage", not a TypeError.
5555
if (typeof body !== "string") return null;
56-
// A NUMBER IS NOT AN OUTAGE, AND MUST NOT BE A TypeError EITHER. Six of this
57-
// file's seven probes resolve `ERR:${e.code}`; the seventh resolves a bare
58-
// statusCode on success, and its caller filters out 200 and hands the rest
59-
// here. Measured on CI Node 22: one 502 reached this line and the case died
60-
// as `body.startsWith is not a function` — a crash where the answer is
61-
// simply "that was a reply, not an outage".
62-
if (typeof body !== "string") return null;
6356
if (!body.startsWith("ERR:")) return null;
6457
if (/"carrying"\s*:\s*"gap-relay"/.test(body)) return null;
6558
if (/"status"\s*:\s*"degraded"/.test(body)) return OUTAGE.DEGRADED;
@@ -236,19 +229,6 @@ describe("held port (CACHE_FIX_HOLD_PORT)", { concurrency: CONCURRENCY }, () =>
236229
assert.equal(readyBody(""), false);
237230
});
238231

239-
// THE SEVENTH PROBE RESOLVES A NUMBER. Six of this file's probes resolve
240-
// `ERR:${e.code}`; the one at the forced-kill case resolves a bare statusCode
241-
// on success, and its caller filters out 200 and hands the rest to classify().
242-
// A 502 therefore reaches it as a Number. Pinned as a unit case because the
243-
// path only opens when a non-200 is actually observed — CI Node 22 saw one and
244-
// the case died as `body.startsWith is not a function`, three runners apart
245-
// from where it was introduced.
246-
it("classify survives a probe that answers with a status code", () => {
247-
assert.equal(classify(502), null, "a status code is a reply, not an outage");
248-
assert.equal(classify(200), null);
249-
assert.equal(classify("ERR:ECONNREFUSED"), OUTAGE.REFUSED);
250-
assert.equal(classify("ECONNRESET"), null, "no ERR: prefix means it is not ours to classify");
251-
});
252232
// The default is declared in proxy/config.mjs and repeated in the launcher.
253233
// If they drift, an unset CACHE_FIX_PROXY_PORT binds one port while callers
254234
// dial the other.

0 commit comments

Comments
 (0)