Repository navigation
Description
Context
After the test-integrity work landed, a refreshed Gremlins v0.6.0 run on main (c3b00f1, --timeout-coefficient 20 --workers 2, unit tests only, no -race) measured:
| Package | Test efficacy | Mutator coverage | Killed / Lived / Not-covered / Timed-out |
|---|---|---|---|
b2 |
96.54% | 96.66% | 754 / 27 / 27 / 17 |
base |
92.44% | 78.67% | 208 / 17 / 61 / 0 |
(Up from the #97 baseline of 64.05% / 71.88%.) This issue tracks closing the remaining gaps the run surfaced. Two kinds of work; do them as separate PRs.
Acceptance criteria
- R1. Part A: a re-run shows the targeted surviving mutants killed (or annotated equivalent); efficacy rises toward the high-90s. Each new test is proven to fail when its production line is reverted.
- R2. Part B:
monitor.gohas unit coverage; remaining not-covered lines are either covered or documented as live-only. - R3. Depends on the Gremlins CI adoption (ci: evaluate and adopt mutation testing (gremlins, go-mutesting, ooze) #97) landing first so the numbers are reproducible.
In scope
Part A — kill the surviving mutants (tests exist but don't catch a change)
These lines have a mutant that survived — a change there passes every test. Each is a boundary/arithmetic/negation that needs a test asserting the exact behavior (break-per-claim: revert the fix, the new test must fail).
b2 (27 surviving), concentrated in:
writer.go: 516, 610, 621, 699, 731, 1017, 1022, 1023reader.go: 266, 269, 286, 459replication.go: 215, 219, 251iterator.go: 102, 108accountinfo.go: 162, 221b2.go: 774 ·baseline.go: 414 ·compose.go: 274 ·progress.go: 49 ·sync/sync.go: 351 ·copy.go: 162 ·backend.go: 101
Also resolve the 17 timed-out b2 mutants (mostly writer.go/reader.go) by raising --timeout-coefficient or trimming the slow test so they report a real killed/lived instead of timing out.
base has 17 surviving mutants; the per-line list was not captured (the baseline base run was not saved). Re-run gremlins unleash --timeout-coefficient 20 --workers 2 ./base to enumerate them before fixing.
Note: some survivors may be equivalent mutants (behavior-identical, uncatchable) — annotate and skip those rather than contorting a test. Target the real ones; 100% is not the goal.
Part B — cover untested code (no test reaches it)
b2 has 27 "not covered" mutants, dominated by:
monitor.go: lines 50, 144, 147, 199, 203–205, 226, 230 — the package has effectively no unit tests.lock.go: 65 — file-lock paths (may require live B2).sync/sync.go: 298, 414, 416 ·accountinfo.go: 167 ·backend.go: 1114 ·b2.go: 901 ·replication.go: 26
Add hermetic unit tests where possible (monitor.go first); where a path genuinely needs live B2, document that in docs/testing.md rather than forcing a fake.
Out of scope
- Unrelated work outside the components and behavior described in In scope.
Verification
Run the repository regression checks with live credentials unset:
unset B2_APPLICATION_KEY_ID B2_APPLICATION_KEY B2_ACCOUNT_ID B2_ACCOUNT_KEY
go build ./...
go vet ./...
go test -race -count=1 ./b2/... ./base- Use Gremlins v0.6.0 without
-race, recording the measured ref and configuration. Preserve the issue's historical baseline as historical, rather than claiming it is a fresh measurement. - Apply each targeted mutation independently; record red output for the relevant test and green output after restoration. Explain equivalent mutants instead of contorting tests.
- Re-run the specified base enumeration:
gremlins unleash --timeout-coefficient 20 --workers 2 ./base; record per-package killed/lived/not-covered/timed-out results for the targeted run. - For Part B, record covered paths or the documented reason a path needs live B2.
- Gremlins runs must remain separate from the race-enabled Go regression run.
- Expected result: the checks above succeed and the observable outcomes in Acceptance criteria are demonstrated. If a check cannot run, report
Could not run because: ...; if it starts but fails, reportCould not complete because: .... A skipped check is not a pass.
Links
-
Related issues and pull requests referenced above: ci: evaluate and adopt mutation testing (gremlins, go-mutesting, ooze) #97.
Activity
test(b2): cover account-info chmod cleanup
test(b2): cover sync branches and pin monitor status assertion
test(b2): cover monitor and untested branches
test(b2): cover account-info chmod cleanup
test(b2): cover sync branches and pin monitor status assertion
test(b2): pin account-info and monitor error details
test(b2): pin surviving mutation behavior
test(b2): record full mutation baseline
test(b2): address mutation test review
ci: honor the configured mutation timeout
test(b2): explicitly ignore deferred writer cleanup error
4 remaining items
test(b2): record full mutation baseline
test(b2): address mutation test review
ci: honor the configured mutation timeout
test(b2): explicitly ignore deferred writer cleanup error
test(b2): isolate transfer checks from unbounded loops
docs: reconcile B2 mutation review evidence
test(b2): pin surviving mutation behavior (#293)
ffumero2003 commentedon Nov 5, 2026
Refreshed baseline — Gremlins v0.6.0 on
main@59104c6 (2026-11-05)Measured twice (local + pinned v0.6.0), identical results. #293 has landed;
accountinfo.gonow has zero survivors../b2./basePart A — kill surviving mutants (run as 4 parallel PRs, each "Part of #290")
writer.go: 516 ARITHMETIC_BASE · 610 CB · 621 ARITHMETIC_BASE · 621 INVERT_NEGATIVES · 699 CB · 731 CB · 1017 CB · 1022 CB · 1023 CBreader.go/replication.go/iterator.go: reader 266·269·286·459 CB, 111 CONDITIONALS_NEGATION (timeout); replication 215 CB·219 CB·251 ARITHMETIC_BASE; iterator 102·108 CBbase/base.go(26): 189·192·238·741·820·830·883×2·931·943·1047·1198×2·1417·1559·1844·1847·1873×3·1877·1949×3·1954×2Part B — cover untested code (separate follow-up PR)
Each new test proves break-per-claim (revert the line → test fails); equivalent mutants are annotated and skipped — 100% is not the goal.
docs: record sync mutation evidence and equivalent audits
docs: clarify scoped sync mutation result provenance
test(b2): pin reader first-error cancellation (#294)
test(b2): kill surviving Gremlins mutants in sync worker startup (#290)…
test(base): kill surviving Gremlins mutants in wire helpers (#290) (#296