knowledge: 5 insights — test suites that cannot see, and a throttle the auth path walks past - #28
Open
choiyounggi wants to merge 1 commit into
Open
knowledge: 5 insights — test suites that cannot see, and a throttle the auth path walks past#28choiyounggi wants to merge 1 commit into
choiyounggi wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Knowledge flush — 5 insight(s)
All five were harvested from real sessions. Three merged into
testing/quality/tests-that-cannot-fail, one intotesting/data/test-data-and-isolation, one intobackend/common/reliability/timeouts-and-retries. No new page and no new category — every case had an existing home whose "load when" already overlapped.Verified best-practice
1. A runner that invokes the subject differently than production →
verifiedClaim. A bats suite that calls
bash "$script"on a#!/bin/shfile cannot detect bashisms, because the shebang is bypassed; a green run is evidence about bash only.How verified. Reproduced locally rather than argued. A one-line
#!/bin/shscript containing[[ ... ]]:./s.sh(direct — shebang honoured; macOSshis bash in POSIX mode)bash s.shdash s.sh(true POSIX)s.sh: 2: [[: not foundThe mechanism is documented: the
#!interpreter directive is applied by the kernel when a file is executed; passing the file as an argument to an interpreter means the interpreter reads it and the directive never participates (https://man7.org/linux/man-pages/man2/execve.2.html).Confidence: verified (reproduced + documented mechanism).
2. A scripted mutation that never applied ≠ a blind test →
verifiedClaim. When a mutation run drives edits with
sed/awk, a pattern that matches nothing exits 0 and changes nothing, so the suite stays green for the trivial reason that the code is unchanged — indistinguishable from "the tests cannot fail".How verified. Reproduced:
sed -i '' 's/NEVER_MATCHES/x/' f.txt→ exit status 0, file byte-identical. POSIX and GNU both define sed's exit 0 as "completed without error", not "substituted something" (https://www.gnu.org/software/sed/manual/html_node/Exit-status.html, https://man7.org/linux/man-pages/man1/sed.1p.html).Confidence: verified.
3. Mutate an error-code guard toward unreachable, not always-firing →
field-testedClaim. Mutating
if [ "$x" != "ok" ]; then exit 6; fiso the guard fires more leaves the exit-code test green — it asserts "exits 6", and the mutant produces more 6s. Only making the guard unreachable answers "does this test go red without the guard".How verified. No external source states this direction rule; it follows from the mutation-testing notion that a mutant which cannot change observable behavior is not a useful mutant (https://stryker-mutator.io/docs/mutation-testing-elements/equivalent-mutants/, already cited by the sibling page
harness-reverse-controls). The session evidence is concrete: five exit-6 tests stayed green under an always-firing mutation, and all five went red under the never-firing one.Confidence: field-tested — the reasoning is sound and the observation reproducible in that repo, but the rule itself is not stated in a primary source.
4.
env VAR=x cmdinherits the caller's environment →verifiedClaim. A test case that assumes a variable is absent silently flips when the suite runs from a session that exports it, because
envmerges rather than replaces.How verified. POSIX is explicit:
name=valuearguments "shall be placed into the inherited environment", and only-imakesenvignore the inherited environment completely (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html, https://www.man7.org/linux/man-pages/man1/env.1p.html). Reproduced locally:env OTHER=1 sh -c 'echo $LEAKED'printed the caller's value;env -iprinted nothing.Confidence: verified.
This one has provenance worth noting: it is the answer to a mystery from the session that produced it. A worker pinned a
128 ok / 6 not okbaseline that the coordinator could not reproduce (four measurements said 134/134). The 6 failures were real — in a worker session that exportsGROUNDWORK_ESCALATION_DIR, which is exactly the variable those cases assume is unset.5. A client-side throttle that the auth path bypasses →
field-testedClaim. Token/auth refresh usually happens inside a header builder or interceptor, below the throttle layer, so the token POST and the real call land in the same second and deterministically breach a 2-per-second cap — but only on days the token cache is cold, which makes it read as intermittent.
How verified. This is an architectural observation about where a refresh sits relative to a rate limiter, not a claim any vendor doc makes; searching for a primary source that states it turned up none. The session evidence is a specific timeline (token POST 00.354 → issued 00.495 → balance call failed 00.543, on the two days the token was newly issued; identical code fine on cache-valid days).
Confidence: field-tested — recorded as such on the page, not upgraded.
Existing-layer check
Pages read before deciding:
INDEX.md;wiki/testing/index.md;testing/quality/tests-that-cannot-fail,testing/quality/harness-reverse-controls,testing/data/test-data-and-isolation;wiki/platforms/index.mdandplatforms/shells/portable-shell-scripts;wiki/backend/index.md,backend/common/reliability/timeouts-and-retries;wiki/debugging/index.md.Overlaps found, and what they changed:
platforms/shells/portable-shell-scriptsalready carries the platform half of insight 1 — "#!/bin/shscript passes on macOS, fails on Debian/Ubuntu … test under dash". Duplicating it there would have added nothing. What is not covered anywhere is that a test suite invokingbash "$script"is structurally incapable of catching it, which is a "can this test detect a defect" question. Merged intotests-that-cannot-fail's never-fails table and cross-linked to the platforms page.tests-that-cannot-failstep 1 already prescribes manual mutation testing, and its edge-case table already routes self-built mutation harnesses toharness-reverse-controls. Insights 2 and 3 are failure modes of that step, so they became twoEdge casesrows there rather than a new page —harness-reverse-controlsanswers a different question (whether to cite a harness's score).test-data-and-isolationalready has "environment variables mutated by a test → set in setup, restore in teardown". Insight 4 is the opposite direction: a test that never touches the variable and depends on its absence. Added as its own row beside it.timeouts-and-retriescovers outbound-call governance including capping concurrency. No rate-limiting page exists anywhere underbackend/, and insight 5 is one edge case rather than a page's worth, so it merged there and links todebugging/concurrency/intermittent-failures.Conflicts flagged: none. No new directive contradicts an existing one.
Related-links added:
tests-that-cannot-fail→platforms-shells-portable-shell-scripts;timeouts-and-retries→debugging-concurrency-intermittent-failures.Routing decision
tests-that-cannot-fail(never-fails table)tests-that-cannot-fail(edge cases)tests-that-cannot-fail(edge cases)env VAR=xinherits;unsetin setuptest-data-and-isolation(isolation table)timeouts-and-retries(edge cases)No new category. Insight 1 was the only real routing question — testing vs platforms. It went to testing because the directive is about what a suite can prove, and the platforms page already owns the portability fact it would otherwise duplicate.
Plumbing:
wiki/testing/index.mdandwiki/backend/index.md"load when" lines widened so the new triggers actually route; threelog.mdentries added. All three edited pages remain well under the 120-body-line limit (61 / 59 / 68).