Skip to content

Unskip and fix disabled tests#21455

Merged
yperbasis merged 11 commits into
mainfrom
yperbasis/unskip-disabled-tests
Jun 3, 2026
Merged

Unskip and fix disabled tests#21455
yperbasis merged 11 commits into
mainfrom
yperbasis/unskip-disabled-tests

Conversation

@yperbasis
Copy link
Copy Markdown
Member

@yperbasis yperbasis commented May 27, 2026

Summary

A sweep of the repo's unconditionally-disabled testst.Skip(...) not gated on testing.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 TestT8n surfaced 5 stacked bugs, all fixed here:

  1. getTransaction dropped the JSON v/r/s, so signed txs got a zero signature → ErrInvalidSig. Now preserves V/R/S (new TestGetTransactionPreservesSignature).
  2. E3 state plumbingMakePreState read base state from tx while writing to SharedDomains (execution saw balance 0), and CalculateStateRoot used a fresh SharedDomains (→ empty-trie root). Now reads/commits on the same sd that executed, then flushes and records the block→txNum so the alloc dumper sees the post-state.
  3. EphemeralExecResult.Difficulty now serializes as hex (*math.HexOrDecimal256), matching the spec. (Only non-test change; the field is marshaled solely by t8n.)
  4. A blockhash requested but missing from the env now yields exit code 4 instead of a silent tx rejection.
  5. Empty receipts serialize as null, matching the reference output.

Deliberately left skipped

  • node/app/component gomock tests (TestComponentLifecycle, TestDomainLifecycle, TestAddRemoveDeps) — left skipped; this PR doesn't touch them. The whole package is disabled by a pre-existing TestMain os.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.
  • HexPatriciaHashed trapsTest_ModeUpdate_SiblingConsistency (parallel commitment calculator: ModeUpdate sibling-encoding bug #20961) and Test_HexPatriciaHashed_StateRestoreAndContinue (concurrent map write): consensus-critical, left as regression markers.
  • Feature-gatedexecmodule background-commit and component/fuzz_test wait on features not yet built.
  • node.TestRegisterProtocols — empty // TODO stub for p2p registration that moved to sentry; recommend deleting.
  • Likely real bugs, left for owner judgmentexecution/state.TestCreateOnExistingStorage (Erigon keeps pre-existing storage on CREATE-over; go-ethereum clears it) and db/test.Test_AggregatorV3_RestartOnDatadir_{WithoutDB,WithoutAnything} (restart-from-files-without-DB fails commitmentdb freshness).

Testing

make lint clean, make erigon integration builds, and every touched test passes (resource-gated ones skip cleanly without their resources). Latest main is merged in, which brings #21505's removal of the legacy headerdownload / bodydownload / dataflow packages.

🤖 Generated with Claude Code

yperbasis and others added 3 commits May 27, 2026 22:59
…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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by ii.buildFiles is 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.

Comment thread cmd/rpcdaemon/graphql/graphql_test.go Outdated
…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>
@yperbasis yperbasis force-pushed the yperbasis/unskip-disabled-tests branch from 667a9fd to f2c8a81 Compare May 27, 2026 21:45
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.
@yperbasis yperbasis marked this pull request as ready for review May 28, 2026 08:40
@yperbasis yperbasis added the QA label May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Comment thread node/app/component/component_test.go
Comment thread cmd/rpcdaemon/graphql/graphql_test.go
yperbasis and others added 2 commits June 1, 2026 10:18
…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>
@yperbasis yperbasis added this pull request to the merge queue Jun 3, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2026
@yperbasis yperbasis enabled auto-merge June 3, 2026 07:57
@yperbasis yperbasis disabled auto-merge June 3, 2026 12:41
@yperbasis yperbasis added this pull request to the merge queue Jun 3, 2026
Merged via the queue into main with commit 0e52364 Jun 3, 2026
88 checks passed
@yperbasis yperbasis deleted the yperbasis/unskip-disabled-tests branch June 3, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants