Repository navigation
ci(e2e): cut avoidable setup time from the e2e workflow - #1459
Conversation
…mage Shorten the critical rotate leg of the e2e workflow without changing what is tested: - Run actions/setup-go after checkout so its module/build cache is keyed from repository files and actually restores (it never did: go.mod was not checked out yet). Use a dedicated key (go.sum, test/e2e/Makefile, BLS headers) instead of the go.mod hash shared with tests.yml and lint.yml, whose caches hold -race and lint artifacts. BLS headers are keyed because the Go build cache does not track cgo's C dependencies. Gate it like the other build steps. - Export the GHA docker layer cache from the dashcore leg only; both legs still read it. - Exclude .git from the E2E image build context via a Dockerfile-specific ignore file. The root .dockerignore keeps .git: DOCKER/Dockerfile stamps the release version with `git describe`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
testNode ran every node subtest sequentially, so the e2e test phase grew linearly with the node count (~93 s on the 13 stateful nodes of rotate). Run them in parallel, capped at 4 via -test.parallel in the runner. That bounds RPC load on 4-vCPU CI runners and matches their default GOMAXPROCS. Coverage is unchanged: the same tests, nodes and assertions, and top-level tests stay sequential. - testNode calls t.Parallel() in each node subtest. Its doc comment now says the callback must use the ctx it is given (the caller's deferred cancel has already run) and treat captured data as read-only. - TestApp_Tx guards its shared *rand.Rand with a mutex; it is not safe for concurrent use. History: t.Parallel() was part of testNode originally. Upstream tendermint #7516 (09aa100, "e2e: constrain test parallelism and reporting") removed it together with adding -test.v and sorting nodes, without stating a reason. #7523 (ac57896) then introduced the shared *rand.Rand that relied on sequential subtests. Shared test state (testnet and block caches, node sort) is only touched from parent test bodies, and node subtests only read shared data. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The parallel node subtests were checked for data races by code review only; a local -race run against a testnet could not be scheduled. Leave a TODO in testNode so the check isn't forgotten. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
PR HygieneState: waiting-bots · commit
Self-review is an author attestation for this exact commit: This report does not bypass CI or repository protection rules. |
|
🕓 Queued for automated review — 1st in line, estimated start in ~10 min (commit 39eadca)
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The CI and E2E parallelization changes appear functionally sound and aligned with the stated goal. The new comment in the parallel subtest uses a TODO marker, which violates the repository’s explicit style rule prohibiting TODO comments; replace it with an issue reference or remove it after validation.
💬 1 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: general); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
normalbygpt-6-astra(effort low) — The diff makes cross-cutting CI, Docker build-context, and concurrent end-to-end test-runner changes that require validating cache behavior and test isolation, but it does not alter a critical surface such as consensus, funds, cryptography, networking deserialization, or storage migration. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 11% left, 5h 100% left),glm-5.3-flash(zai below 15% reserve: 5h 100% left, weekly 13% left) - Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `test/e2e/tests/e2e_test.go`:
- [NITPICK] test/e2e/tests/e2e_test.go:74-77: Remove the newly added TODO comment
The project instructions explicitly prohibit TODO markers and require follow-up work to be tracked in an issue instead. This newly added comment documents an unfinished race-validation step for the concurrency change, so it should either be removed after race-enabled validation or rewritten to reference a concrete issue without using the TODO marker.
TL;DR: The end-to-end test job in CI takes about 20 minutes. This PR removes avoidable waiting in how that job is set up, and checks the test nodes several at a time instead of one by one, so results arrive sooner. What is tested stays exactly the same.
User story
As a contributor opening a pull request, I want the end-to-end tests to report back faster, so I can iterate on changes without waiting on avoidable CI overhead.
Scenario
Base flow
A contributor pushes a change touching Go code and waits for the two end-to-end jobs (
dashcore,rotate) to finish.Actual behavior
Each job compiles the test tooling from scratch every time, because its cache never loads. Both jobs also upload the same large Docker cache. The longer
rotatejob waits for that upload before it can start testing.Once the test network is running, the final checks visit each of its 13 nodes one at a time.
Expected behavior
The test tooling is restored from cache, and only the shorter job uploads the Docker cache. The final checks visit up to 4 nodes at once. The same tests then run against the same network setups, but they start sooner and finish sooner.
Detailed discussion
What was done
Go cache (
.github/workflows/e2e.yml):actions/setup-goran beforeactions/checkout, so its cache step found nogo.modand never restored anything (Restore cache failed: Dependencies file is not found). "Build runner and tests" was a cold 92–99s build on every leg.go.sum,test/e2e/Makefile, BLS headers. The default go.mod-hash key is shared withtests.yml/lint.yml, whose caches hold-race/lint artifacts.Docker layer cache: both legs read
type=gha, but only thedashcoreleg exports it (cache-tois empty onrotate). This removes ~21s of "exporting to GitHub Actions Cache" from the criticalrotateleg..gitexcluded from the E2E image context viatest/e2e/docker/Dockerfile.dockerignore, a BuildKit per-Dockerfile ignore file that replaces the root one for this build only..dockerignoreis unchanged in content:DOCKER/Dockerfile(release images) stamps the version viagit describe.COPY . ./make nodelayers can be reused, e.g. when a flaky run is retried on the same commit.Not done: overlapping the host build with the Docker build. With the Go cache fixed the host build drops to ~5–15s, so the ≤15s gain doesn't justify a background process that has to survive across steps.
Parallel per-node subtests (
test/e2e/tests,test/e2e/runner/test.go), in a separate commit.testNoderan every node subtest sequentially, so the test phase took ~93s onrotate's 13 stateful nodes.t.Parallel(), capped at 4 via-test.parallelin the runner (a named constant). The cap matches CI's GOMAXPROCS and bounds RPC load on 4-vCPU runners.TestApp_Tx's*rand.Rand, which is now mutex-guarded. The testnet and block caches and the node sort are only touched in parent test bodies, node subtests only read shared blocks and manifest data, and each subtest creates its own RPC client and ctx.t.Parallel()here together with adding-test.vand node sorting, with no stated reason.rotate: ~93s → ~35–45s.Unchanged: matrix (
dashcore,rotate),fail-fast, runner invocation and networks, node build flags (-gcflags=all=-N -l -tags deadlock), GIT_DIFF gating, log upload and cleanup.Measured baseline, 7 recent green runs: rotate leg 1103–1286s = setup ~40s + host build 92–99s + docker 151–248s + testnet 808–961s.
Testing
actionlint1.7.12: no findings.yamllintwith the repo config: only a pre-existing warning on an untouched line.docker buildx build -f test/e2e/docker/Dockerfile .succeeds. The image has no/src/tenderdash/.git, andgo version -m /usr/bin/appshows unchanged build flags with novcs.*stamping. A probe confirmed buildx 0.37 honours the per-Dockerfile ignore file.gofmt/goimportsclean.golangci-lint(repo config, new code only) reports 0 issues.make runner testsbuilds, and the tests binary lists the same 12 top-level tests as before.-test.voutput, androtateflake rate under the extra concurrent RPC load during the test phase.Breaking changes
None. CI-only change.
Checklist
Prior work
build.yml,govulncheck.ymlandcheck-generated.yml.🤖 Generated with Claude Code