Skip to content

test(e2e): cost-control safety net for real-AWS tiers (#47) - #48

Merged
scttfrdmn merged 1 commit into
mainfrom
test/tier1-run
Jun 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
test/tier1-run

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Refs #47. Makes the real-AWS test tiers safe to run — the prerequisite for Tier 2/3.

Why

Running Tier 1 against real AWS surfaced 67 leftover e2e instances in spore-host-dev from prior Tier 2/3 runs whose cleanup had failed — one running 12 days, ~54 stopped accruing EBS. For an ephemeral-infra / cost-control project, that's an existential bug. (All 67 terminated manually.)

Defense in depth

Layer What
Reaper (reaper.go, real-AWS tiers only) TestMain terminates any e2e-* instance older than 30m across us-east-1/us-east-2 before and after every run. Heals leaks from killed/timed-out runs where t.Cleanup never fires.
Leak-check (TestTier1_NoLeakedInstances) API-only (~$0) test that fails the build if any e2e-* instance outlives the threshold. Silent leakage → red build.
Cleanup fix (tier3) stop → terminate --yes. Stopping leaked EBS-charged instances forever — the bulk of the 67.
Comment fix (helpers) terminateByName already terminates; corrected its misleading "stops" doc.
Regression fix (tier1) lagotto cancel cleanup/step now pass -y (cancel prompts after #40; closed stdin would EOF→abort and leak the watch).

Verified against real AWS (spore-host-dev)

Full Tier 1 suite green (~49s), reaper runs each phase, leak-check reports "cost control intact", and an independent describe-instances confirms 0 e2e instances remain. Tier 0 (substrate) deliberately excluded from the reaper build tag.

Does not fully close #47 — the reaper + leak-check are the prevention; remaining items there (tagging scheme, applying to all Tier 2/3 launch paths) land when we do the Tier 2/3 work, now that it's safe to run.

A Tier 1 leak-check found 67 leftover e2e instances in spore-host-dev
(one running 12 days) from prior Tier 2/3 runs whose cleanup failed.
For an ephemeral-infra project, leaked instances are an existential bug.
Defense in depth so a leak can't survive a run:

- reaper.go: TestMain (real-AWS tiers only) reaps any e2e-* instance older
  than 30m across us-east-1/us-east-2 before AND after the suite — so a
  killed/timed-out run that skips t.Cleanup is healed by the next run.
- TestTier1_NoLeakedInstances: API-only guard that FAILS the build if any
  e2e-* instance outlives the threshold. Silent leakage → red build.
- tier3: cleanups now 'terminate --yes', not 'stop' (stopping leaked
  EBS-charged instances indefinitely — the bulk of the 67).
- helpers: corrected terminateByName's misleading 'stops' comment (it
  already terminates).
- tier1: lagotto cancel cleanup/step now pass -y (cancel prompts after
  spawn#40; closed stdin would EOF→abort and leak the watch).

Verified against real AWS (spore-host-dev): full Tier 1 green, reaper runs,
leak-check reports 'cost control intact', 0 e2e instances remain.

Refs #47
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e Tier 2/3 tests leak instances — cleanup stops instead of terminating, no reaper safety net

1 participant