Repository navigation
chore(deps): truffle v0.58.0, and migrate 21 tests off a fabricated AMI - #722
Merged
Merged
Conversation
Bumping truffle to v0.58.0 — for the Nitro generation data it now exposes — also moves the substrate test emulator v0.97.0 -> v0.120.0 transitively, and that broke 21 tests across 5 packages in one step. Root cause, which is not the AWS SDK and not spawn: v0.120.0 validates AMI ids where v0.97.0 did not. That is CORRECT — real EC2 answers InvalidAMIID.NotFound — but the emulator ships with ZERO images, so the fabricated "ami-12345678" these tests passed to RunInstances had no valid replacement. I checked DescribeImages on a fresh server: zero. So no valid AMI id existed at all. Fixed by registering a real AMI via RegisterImage, in one shared testutil.RegisterTestAMI rather than per package. That is what a caller would do against EC2, so the tests stop depending on how lenient the emulator happens to be — the same reasoning as truffle#177, which decoupled three of its own tests from emulator gaps instead of pinning the emulator back. Filed upstream as substrate#1432. Deliberately framed as a note and a suggestion rather than a bug: the new strictness is an improvement, and what would have helped is a changelog line or an error that hints at the missing RegisterImage. Two judgement calls worth stating: PURE-LOGIC TESTS KEEP A LITERAL ID. My first pass replaced every occurrence and broke the PlanCapacity tests, which have no substrate server at all — they never call EC2. A test that does not touch AWS should not acquire an emulator dependency, so those keep "ami-12345678" as inert data. ONE TEST NEEDED MORE THAN AN AMI. TestEC2Provider_LookupAndTagEBSCost_NoVolumes IsNotMeasured asserts that an instance with NO discoverable EBS volumes reports an unmeasured fallback (#517 defect 2). Its own comment admitted the premise came from "the substrate emulator's DescribeInstances response doesn't populate them". v0.120.0 populates them, and attaches a root volume whether or not the AMI declares a RootDeviceName — I tried nil and still got a volume. So that scenario is unreachable through the emulator now. Rather than contrive it, the test points at a nonexistent instance id and reaches the same documented fallback deterministically. Its previous comment already noted the two branches are "the same shape of fallback ... just reached one branch earlier", so the contract under test is unchanged. It was passing because of something substrate had not implemented, not because of anything spawn did, which is the part worth not restoring. lambda/ttl-reaper needed its own go mod tidy — nested modules pin their own deps and would otherwise fail CI with "updates to go.mod needed". Suite is fully green: 0 failures, vet and gofmt clean, docs-gen current.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
All three traced to verification gaps on my side rather than new breakage.
E2E Tier 0: test/e2e/tier0_status_json_test.go passed the same fabricated
ami-12345678. I missed it because that file is behind //go:build e2e_tier0, so
`go test -short ./...` never compiles it — my local green was measuring less than
CI does. Now uses testutil.RegisterTestAMI like the rest; verified with
`go test -tags e2e_tier0`, which is the invocation I should have run before
claiming the suite was clean.
Test job ("Lambda modules") and Go Vulnerability Check ("Scan all modules") were
one cause: I tidied lambda/ttl-reaper and assumed it was the only nested module
affected. It was not — alert-handler, autoscale-orchestrator and sweep-orchestrator
needed it too. Nested modules pin their own deps behind a replace to the root, so a
root bump leaves them stale and BOTH jobs fail with "updates to go.mod needed",
which says nothing about a vulnerability and is easy to misread as one.
Verified by running what CI runs rather than what is convenient:
- root short suite: 0 failures
- go test -tags e2e_tier0 ./test/e2e/: ok (125s, full tier 0)
- all 11 nested modules: build + vet + test ok
- govulncheck on the root and all 11 nested modules: 0 vulnerabilities
- gofmt, vet, docs-gen clean
This was referenced Oct 7, 2026
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.
Split out from the
doctorNitro work, because it turned out to be a dependency migration rather than a version line. The feature PR follows and depends on this.What happened
Bumping truffle to v0.58.0 — for the Nitro generation data — also moves the substrate test emulator v0.97.0 → v0.120.0 transitively, and that broke 21 tests across 5 packages in one step.
The cause is neither the AWS SDK nor spawn. v0.120.0 validates AMI ids where v0.97.0 did not, which is correct — real EC2 answers
InvalidAMIID.NotFound. But the emulator ships with zero images, so the fabricatedami-12345678these tests passed toRunInstanceshad no valid replacement. I checkedDescribeImageson a fresh server: zero images. No valid AMI id existed at all.Fixed by registering a real AMI through
RegisterImage, in one sharedtestutil.RegisterTestAMIrather than copied per package. That's what a caller would do against EC2, so the tests stop depending on how lenient the emulator happens to be — the same reasoning as truffle#177, which decoupled three of its own tests from emulator gaps instead of pinning the emulator back.Filed upstream as substrate#1432, framed as a note and a suggestion rather than a bug report: the new strictness is an improvement. What would have helped is a changelog line, or an error that hints at the missing
RegisterImage.Two judgement calls
Pure-logic tests keep a literal id. My first pass replaced every occurrence and broke the
PlanCapacitytests — which have no substrate server at all, because they never call EC2. A test that doesn't touch AWS shouldn't acquire an emulator dependency, so those keepami-12345678as inert data.One test needed more than a new AMI.
TestEC2Provider_LookupAndTagEBSCost_NoVolumesIsNotMeasuredasserts that an instance with no discoverable EBS volumes reports an unmeasured fallback (#517 defect 2). Its own comment admitted where the premise came from:v0.120.0 populates them, and attaches a root volume whether or not the AMI declares a
RootDeviceName— I triedniland still got a volume. So that scenario is unreachable through the emulator now.Rather than contrive it, the test points at a nonexistent instance id and reaches the same documented fallback deterministically. Its own comment already noted the two branches are "the same shape of fallback ... just reached one branch earlier", so the contract under test is unchanged. The part worth not restoring is that it was passing because of something substrate hadn't implemented, not because of anything spawn did.
Also
lambda/ttl-reaperneeded its owngo mod tidy— nested modules pin their own deps and would otherwise fail CI withupdates to go.mod needed.Verified
go vet,gofmt,docs-genall cleanlambda/ttl-reaperbuildsThe SDK minimums (
service/ec21.321.1 → 1.335.0,sts1.45.5 → 1.51.0, plusconfig/credentials/imds/smithy-go) are required by truffle v0.58.0's own go.mod, not chosen here.