erigon-test-race

Runs Erigon Go test suites with the race detector to find data races and concurrency bugs.

3.6k|1.5k|Updated May 27, 2019
One-click install
npx skills add https://github.com/erigontech/erigon --skill erigon-test-race
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erigon-test-race
Source: https://github.com/erigontech/erigon/tree/main/.claude/skills/erigon-test-race
Command: npx skills add https://github.com/erigontech/erigon --skill erigon-test-race

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Concurrency bugs in Erigon's parallel executor, p2p, and txpool code often pass normal tests but corrupt state under real load. This Skill runs the full Go test suite with the -race flag to surface data races before they reach production.

Core Features & Use Cases

  • Full race-detector test run: Executes make test-all-race with a RAM disk backing the heavy temp-file I/O of the execution tests suite.
  • EEST spec race shards: Builds the race-instrumented evm.race binary and runs dedicated EEST spec test shards for stable, devnet, and legacy blocktests.
  • Targeted drill-down: Re-runs individual failing packages with go test -race and interprets race detector stack traces to locate the conflicting goroutines.
  • Use Case: After modifying the parallel executor in execution/exec3, run the race gate (make lint plus make test-all-race with a RAM disk) to confirm no data races were introduced before merging.

Quick Start

Ask the assistant to run the Erigon race detector tests, and it will create a RAM disk, set ERIGON_EXECUTION_TESTS_TMPDIR, and execute make test-all-race.

Frequently Asked Questions about erigon-test-race

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Erigon tests with the Go race detector?

Create a RAM disk with bash tools/create-ramdisk, export its path as ERIGON_EXECUTION_TESTS_TMPDIR, then run make test-all-race. For a single package, use go test -race --timeout 60m on the target package path.

How do I run EEST spec tests with race detection in Erigon?

Use the dedicated Makefile shards such as make eest-spec-blocktests-stable-race-pre-cancun-sequential, which build the race-instrumented evm.race binary automatically. Avoid calling tools/run-eest-spec-test.sh directly with EVM_BIN, since that bypasses the rebuild and can use a stale binary.

Why is a RAM disk needed for Erigon race tests?

The execution/tests suite performs heavy temp-file I/O, and backing it with tmpfs avoids disk bottlenecks and matches CI behavior. The tools/create-ramdisk script works on Linux, macOS, and Windows, with size configurable via RAMDISK_SIZE_MB.

Which Erigon packages are most prone to data races?

Historically race-prone areas include execution/exec3 (parallel executor, SharedDomains, AsyncTx), p2p (sentry and peer manager), txpool, and the cl Caplin consensus layer goroutines. Changes in these areas should always be validated with the race detector.

Why do race tests report races in code that no longer exists?

This happens when a stale evm.race binary is reused after pulling or switching branches. Delete build/bin/evm.race and rebuild with make evm.race before re-running the EEST race shards.