feat: add autobahn integration tests - batch 1 (CON-249)#3234
feat: add autobahn integration tests - batch 1 (CON-249)#3234wen-coding merged 5 commits intomainfrom
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3234 +/- ##
=======================================
Coverage 59.28% 59.29%
=======================================
Files 2070 2070
Lines 169780 169771 -9
=======================================
+ Hits 100659 100663 +4
+ Misses 60331 60319 -12
+ Partials 8790 8789 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
f991399 to
0f0b163
Compare
5 tests with autobahn-enabled guard on each: 1. Block production (height advancing) 2. Bank transfer (send and verify balance) 3. Fault tolerance - one node down (3/4 quorum continues) 4. Two nodes down (chain halts, no quorum) 5. Recovery (restart node, chain resumes) Usage: make autobahn-integration-test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3e88223 to
30294d8
Compare
Replace the bash harness (autobahn_tests.sh) with a Go test binary guarded by the autobahn_integration build tag. Behavior matches the bash version with a few improvements: - Cluster size and max BFT faults are discovered at test start from `docker ps` output, so fault-tolerance tests scale with the cluster. - Log checks run via `docker exec grep` inside each running container, so killed nodes don't false-positive on stale host-side log files. - Height polling has an explicit 100ms per-request HTTP timeout and a 500ms sleep between attempts, bounding a hung-RPC scenario to ~36s. Makefile: invoke `go test -tags autobahn_integration` instead of the shell script. GOWORK=off so a stray ambient go.work doesn't interfere. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| // sei-node-* containers. | ||
| func listRunningNodes(t *testing.T) []string { | ||
| t.Helper() | ||
| out, err := exec.Command("docker", "ps", |
There was a problem hiding this comment.
nit: given that we already run docker commands from here, would it make sense to spawn & teardown the docker cluster from go as well?
There was a problem hiding this comment.
Good point, changed
| return 0, err | ||
| } | ||
| var parsed struct { | ||
| Response struct { |
There was a problem hiding this comment.
is this type exported by sei-tendermint by any chance?
| } | ||
| clusterSize = len(names) | ||
| // BFT tolerates f faults in a cluster of n = 3f + 1. | ||
| maxFaults = (clusterSize - 1) / 3 |
There was a problem hiding this comment.
here we hardcode weights of the cluster. Add a TODO to address that, once custom weights are supported (or skip logging it)
Address pompon0's review on #3234: the n = 3f + 1 formula assumes uniform validator weights. Add a TODO and surface the assumption in the log line. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address pompon0's review on #3234: replace the local anonymous struct and Sscanf shim with the exported coretypes.ResultABCIInfo + tmjson decoder. tmjson is needed because tendermint's RPC encodes int64 as a JSON string, which stdlib encoding/json can't decode into int64. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address pompon0's review on #3234: move cluster start/wait/stop out of the Makefile and into TestMain so the test is self-contained — you can run it directly with `go test -tags autobahn_integration ./...` and it spins up the cluster, polls readiness, tears it down on exit. - findRepoRoot walks up for go.mod so the test works from any CWD - The readiness check counts sei-node-* containers via docker ps, so no node count is hardcoded — the cluster size comes from compose - Makefile target collapses to a single `go test` invocation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* main: Giga store migration guide (#3227) Update SS write/read modes into single evm-ss-mode (#3278) fix(evmrpc): return empty array instead of null for eth_getFilterLogs and eth_getFilterChanges (#3292) feat: add autobahn integration tests - batch 1 (CON-249) (#3234) add block height modified to legacy data (#3276) Export ProposerPriorityHash metric for divergence monitoring (#3277) backport CW/wasmd@76eaff4 (#3258)
Summary
Add
make autobahn-integration-testtarget with 5 integration tests for the autobahn consensus mode:abci_info)-b sync, poll for balancefnodes (BFT bound), chain continuesf + 1, chain haltsTest harness is a Go test binary (
integration_test/autobahn/autobahn_test.go) guarded by theautobahn_integrationbuild tag, so it's excluded from the defaultgo test ./...run and only invoked viamake autobahn-integration-test.The cluster size is discovered at runtime via
docker ps, andmaxFaults = (clusterSize - 1) / 3derives the BFT bound — fault-tolerance tests auto-scale to whatever cluster size docker-compose.yml declares. Log checks run viadocker exec grepinside each running container, so stale host-side logs from prior runs can't false-positive.Every test is guarded by
assertAutobahnEnabledwhich checksGigaRouter initializedin every running node's log.Known workarounds (with TODOs)
abci_infoinstead of/statusfor height because/statusreads from the CometBFT block store, which autobahn does not populate-b syncinstead of-b blockbecause CometBFT consensus is disabled in autobahn modeUsage
Test plan
make autobahn-integration-testpasses tests 1–4 locally🤖 Generated with Claude Code