Unskip and fix disabled tests#21455
Merged
Merged
Conversation
…d unit tests Resurrect unit tests that were disabled with unconditional t.Skip and make them pass against current behavior: - db/state: Test_mergeEliasFano fed overlapping lists to multiencseq.Merge (which requires s1.Max() <= s2.Min()) and decoded the result with the wrong reader; the scan_prune subtests of TestInvIndexPruningCorrectness and TestHistoryPruneCorrectnessWithFiles now assert scan-prune's real contract (prunes the whole range, ignores limit for keys). - db/kv/kvcache: TestCode writes code via the code domain instead of the removed tx.Put(kv.Code, ...); TestAPI was a stale skip. - common/log/v3, p2p/enode: stale skips (TestFairMixRemoveSource is #15019, fixed; verified under -race). - execution/tests: TestEIP1559Transition uses a PoW-London config so the ethash faker computes consistent difficulty and pays the block reward, and reads post-block state at blockNum+1. - execution/commitment/trie: TestValue asserts the real inline-RLP encoding. - node/app/component: the gomock AnyTimes() fix already landed; skips stale. - execution/stagedsync/headerdownload: TestSideChainInsert's expected total difficulty now includes the genesis block's difficulty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…gate resource-dependent tests on preconditions Convert unconditional t.Skip into precondition guards so these tests run when their resource is present and skip cleanly otherwise (instead of being permanently disabled): - db/seg: TestDecompressTorrent / BenchmarkDecompressTorrent skip if the hard-coded snapshot file is absent. - txnprovider/txpool: the four throughput/latency benchmarks skip if the required local node(s) aren't reachable. - cmd/rpcdaemon/graphql: TestGraphQLQueryBlock skips if rpcdaemon isn't listening on :8545. - execution/commitment: TestTrieTraceReplayFromFile is gated on ERIGON_TRIE_TRACE_FILE. - cl/persistence: the three OOM-prone TestStateAntiquary* tests are gated on ERIGON_RUN_HEAVY_TESTS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ut bugs
Unskip TestT8n and TestEvmRun by fixing the bugs they were masking:
- t8ntool.getTransaction dropped the JSON v/r/s, so signed txs (no secretKey)
got a zero signature and were rejected with ErrInvalidSig. Now copies V/R/S
into every constructed tx; guarded by the new TestGetTransactionPreservesSignature.
- t8n E3 state plumbing: MakePreState now reads through the SharedDomains
(NewReaderV3(sd.AsGetter)) so execution sees the prestate; CalculateStateRoot
computes the commitment on that same SharedDomains (a fresh one has no touched
keys and returns the empty-trie root); the post-execution state is flushed and
the block->txNum recorded so the alloc dumper reads the post-state.
- EphemeralExecResult.Difficulty is now *math.HexOrDecimal256 (hex), matching
the spec and the other numeric output fields, instead of decimal *uint256.Int.
- A blockhash requested during execution but absent from the env now yields
t8n exit code 4 (ErrorMissingBlockhash) rather than a silent tx rejection.
- Empty receipts serialize as null, matching the reference t8n output.
- TestEvmRun goldens updated for the (intentional) gas-default and tracer
format changes; the statetest case still detects its fuzz state-root mismatch.
Validated against cmd/evm/testdata/{1,3,4,5,7,8} exp.json.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a large set of unconditional t.Skip(...) calls across the repo by either fixing the underlying behavior, or replacing permanent skips with precondition-gated skips (e.g., requiring a running node, local snapshot file, or an opt-in env var). The most impactful functional changes are in cmd/evm’s t8n tool, where multiple execution/state-root/signature/output issues are addressed to match reference outputs.
Changes:
- Re-enabled and corrected previously disabled unit/integration tests across state merge/prune, trie hashing, enode FairMix, component lifecycle, headerdownload, logging, and EVM/t8n.
- Converted “perma-skipped” resource-dependent tests into cleanly gated tests that skip only when required external resources are absent.
- Fixed t8n/EBE plumbing: preserved JSON tx signatures (v/r/s), computed state root on the executing
SharedDomains, corrected difficulty JSON encoding, enforced missing blockhash as an input error, and aligned empty-receipt serialization.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| txnprovider/txpool/tests/pool_test.go | Replace unconditional skips with a “node reachable” precondition gate for txpool benchmarks. |
| p2p/enode/iter_test.go | Re-enable TestFairMixRemoveSource by removing the skip. |
| node/app/component/component_test.go | Re-enable gomock-based lifecycle tests (adjusted mocking strategy). |
| execution/tests/blockchain_test.go | Re-enable/fix EIP-1559 transition test setup and history reads; introduce PoW London-from-genesis config helper. |
| execution/stagedsync/headerdownload/header_algo_test.go | Re-enable side-chain insert test and correct TD expectations to include genesis difficulty. |
| execution/protocol/block_exec.go | Change EphemeralExecResult.Difficulty JSON encoding to hex (HexOrDecimal256) and adjust assignment. |
| execution/commitment/trie/hasher_test.go | Re-enable and correct value-node hashing expectation (inline/double-RLP behavior). |
| execution/commitment/trie_trace_test.go | Convert manual replay test to env-var driven skip (ERIGON_TRIE_TRACE_FILE). |
| db/state/merge_test.go | Re-enable Elias-Fano merge test and update it to current multiencseq reader/iterator APIs. |
| db/state/inverted_index_test.go | Re-enable and clarify scan-prune tests; adjust expectations for forced/unforced behavior. |
| db/state/history_test.go | Re-enable scan-prune test and update assertions around file-boundary pruning behavior. |
| db/seg/decompress_test.go | Gate local snapshot-file test on file existence rather than unconditional skip. |
| db/seg/decompress_bench_test.go | Gate local snapshot-file benchmark on file existence rather than unconditional skip. |
| db/kv/kvcache/cache_test.go | Re-enable tests; update code-domain test to use SharedDomains + flush and validate cache read path. |
| common/log/v3/log_test.go | Re-enable net/caller stack handler tests by removing skips. |
| cmd/rpcdaemon/graphql/graphql_test.go | Gate GraphQL test on local listener availability (integration-style test). |
| cmd/evm/testdata/evmrun/4.out.2.txt | Update expected stderr regex for statetest output. |
| cmd/evm/testdata/evmrun/4.out.1.txt | Update expected stdout regex for statetest output. |
| cmd/evm/testdata/evmrun/2.out.2.txt | Update expected debug trace gas values. |
| cmd/evm/testdata/evmrun/1.out.2.txt | Update expected JSON trace output (gas + fields). |
| cmd/evm/t8n_test.go | Re-enable TestT8n and TestEvmRun and align expectations with fixed tool output. |
| cmd/evm/internal/t8ntool/transition.go | Fix t8n execution: missing blockhash as input error, commitment/state-root on same SharedDomains, flush + txnum mapping, receipts nulling, preserve v/r/s. |
| cmd/evm/internal/t8ntool/transition_test.go | Add regression test ensuring JSON-supplied signed tx preserves v/r/s. |
| cmd/evm/internal/t8ntool/execution.go | Fix prestate reads to go through SharedDomains-backed reader (E3 plumbing). |
| cl/persistence/state/historical_states_reader/historical_states_reader_test.go | Gate OOM-prone CL tests behind ERIGON_RUN_HEAVY_TESTS=1. |
Comments suppressed due to low confidence (2)
db/state/inverted_index_test.go:353
- In subtest
retire_one_step_no_force, the error returned byii.buildFilesis ignored (sf, _ := ...). If buildFiles fails, this test can panic or produce misleading failures later. Please capture and assert the error (and avoid proceeding on failure).
ii, tx, logEvery, _, _ := setup(t)
collation, err := ii.collate(t.Context(), 0, tx)
require.NoError(t, err)
sf, _ := ii.buildFiles(t.Context(), 0, collation, background.NewProgressSet())
collation.Close()
common/log/v3/log_test.go:318
- The listen error path logs the listener (
l) instead of the error (err):t.Fatalf("Failed to listen: %v", l). This would hide the real failure cause if binding fails.
t.Parallel()
l, err := net.Listen("tcp", "localhost:0") //nolint:noctx
if err != nil {
t.Fatalf("Failed to listen: %v", l)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…est output; probe graphql endpoint CI's race/macos jobs set ERIGON_EXEC3_PARALLEL, which makes the dbg package log an "[env]" WARN line via the root logger (stdout) at package-init — before the evm command can reconfigure logging — corrupting the re-exec'd t8n/evm command's machine-readable output (TestT8n failed with "invalid character 'W'"). Since these are golden tests of the command's data output, strip erigon's "[LVL] [MM-DD|...]" log lines from the captured output before comparing. This is robust to any ERIGON_* var on either stream and mutates no global state. Also address review feedback: the graphql precondition now POSTs to the GraphQL endpoint and skips on a connection error or non-200, instead of only checking that TCP :8545 accepts connections. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
667a9fd to
f2c8a81
Compare
The %v argument was the listener instead of the error, hiding the real cause of a binding failure. Surfaced by unskipping this test in this branch.
…bled-tests Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Un-skipping TestComponentLifecycle, TestDomainLifecycle and TestAddRemoveDeps reintroduced shared-root-domain init() non-determinism in gomock exact-call-count expectations; the same behavior is covered by the real-provider tests in hierarchy_test.go. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
taratorio
approved these changes
Jun 3, 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.
Summary
A sweep of the repo's unconditionally-disabled tests —
t.Skip(...)not gated ontesting.Short(). This removes 24 such skips, either by fixing the underlying behavior or by converting permanent skips into clean precondition gates (live node, snapshot file, env var, RAM) that run when the resource is present and skip cleanly when it isn't. What's intentionally left skipped is listed below.(Out of scope:
testing.Short()skips, Windows/race-guarded skips, runtime precondition guards, and commented-out skips.)t8n /
cmd/evm(the meaty part)Un-skipping
TestT8nsurfaced 5 stacked bugs, all fixed here:getTransactiondropped the JSONv/r/s, so signed txs got a zero signature →ErrInvalidSig. Now preserves V/R/S (newTestGetTransactionPreservesSignature).MakePreStateread base state fromtxwhile writing toSharedDomains(execution saw balance 0), andCalculateStateRootused a freshSharedDomains(→ empty-trie root). Now reads/commits on the samesdthat executed, then flushes and records the block→txNum so the alloc dumper sees the post-state.EphemeralExecResult.Difficultynow serializes as hex (*math.HexOrDecimal256), matching the spec. (Only non-test change; the field is marshaled solely by t8n.)null, matching the reference output.Deliberately left skipped
node/app/componentgomock tests (TestComponentLifecycle,TestDomainLifecycle,TestAddRemoveDeps) — left skipped; this PR doesn't touch them. The whole package is disabled by a pre-existingTestMainos.Exit(0); re-enabling it exposes a data race (fixed in node/app/event: fix data race on eventBus.prevQueueSize #21551) plus a flaky test and a goroutine-leak deadlock, tracked in node/app/component: test package silently disabled by TestMain os.Exit(0) #21552.Test_ModeUpdate_SiblingConsistency(parallel commitment calculator: ModeUpdate sibling-encoding bug #20961) andTest_HexPatriciaHashed_StateRestoreAndContinue(concurrent map write): consensus-critical, left as regression markers.execmodulebackground-commit andcomponent/fuzz_testwait on features not yet built.node.TestRegisterProtocols— empty// TODOstub for p2p registration that moved to sentry; recommend deleting.execution/state.TestCreateOnExistingStorage(Erigon keeps pre-existing storage on CREATE-over; go-ethereum clears it) anddb/test.Test_AggregatorV3_RestartOnDatadir_{WithoutDB,WithoutAnything}(restart-from-files-without-DB failscommitmentdbfreshness).Testing
make lintclean,make erigon integrationbuilds, and every touched test passes (resource-gated ones skip cleanly without their resources). Latestmainis merged in, which brings #21505's removal of the legacyheaderdownload/bodydownload/dataflowpackages.🤖 Generated with Claude Code