Skip to content

feat: add autobahn integration tests - batch 1 (CON-249)#3234

Merged
wen-coding merged 5 commits intomainfrom
wen/add_autobahn_integration_tests
Apr 21, 2026
Merged

feat: add autobahn integration tests - batch 1 (CON-249)#3234
wen-coding merged 5 commits intomainfrom
wen/add_autobahn_integration_tests

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

@wen-coding wen-coding commented Apr 13, 2026

Summary

Add make autobahn-integration-test target with 5 integration tests for the autobahn consensus mode:

  1. Block production — verify height is advancing (via abci_info)
  2. Bank transfer — send usei via -b sync, poll for balance
  3. Liveness under max faults — kill f nodes (BFT bound), chain continues
  4. Halts beyond max faults — kill f + 1, chain halts
  5. Recovery — SKIPPED: autobahn node restart not yet supported (CometBFT handshaker can't reconcile app height vs empty block store)

Test harness is a Go test binary (integration_test/autobahn/autobahn_test.go) guarded by the autobahn_integration build tag, so it's excluded from the default go test ./... run and only invoked via make autobahn-integration-test.

The cluster size is discovered at runtime via docker ps, and maxFaults = (clusterSize - 1) / 3 derives the BFT bound — fault-tolerance tests auto-scale to whatever cluster size docker-compose.yml declares. Log checks run via docker exec grep inside each running container, so stale host-side logs from prior runs can't false-positive.

Every test is guarded by assertAutobahnEnabled which checks GigaRouter initialized in every running node's log.

Known workarounds (with TODOs)

  • Uses abci_info instead of /status for height because /status reads from the CometBFT block store, which autobahn does not populate
  • Uses -b sync instead of -b block because CometBFT consensus is disabled in autobahn mode
  • 30s stabilization wait for autobahn giga connections to establish

Usage

make autobahn-integration-test

Test plan

  • make autobahn-integration-test passes tests 1–4 locally
  • Cluster starts, tests run, cluster stops cleanly (on both success and failure)

🤖 Generated with Claude Code

@wen-coding wen-coding requested review from masih and pompon0 April 13, 2026 17:16
@wen-coding wen-coding changed the title feat: add autobahn integration tests (CON-247) feat: add autobahn integration tests - initial batch (CON-249) Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 20, 2026, 7:14 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.29%. Comparing base (7206ae5) to head (0dba21b).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...int/cmd/tendermint/commands/gen_autobahn_config.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           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     
Flag Coverage Δ
sei-chain-pr 31.31% <0.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...int/cmd/tendermint/commands/gen_autobahn_config.go 18.18% <0.00%> (ø)

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wen-coding wen-coding force-pushed the wen/add_autobahn_integration_tests branch 3 times, most recently from f991399 to 0f0b163 Compare April 15, 2026 17:20
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>
@wen-coding wen-coding force-pushed the wen/add_autobahn_integration_tests branch from 3e88223 to 30294d8 Compare April 16, 2026 19:31
@wen-coding wen-coding changed the title feat: add autobahn integration tests - initial batch (CON-249) feat: add autobahn integration tests (CON-247) Apr 16, 2026
@wen-coding wen-coding changed the title feat: add autobahn integration tests (CON-247) feat: add autobahn integration tests - batch 1 (CON-247) Apr 16, 2026
@wen-coding wen-coding changed the title feat: add autobahn integration tests - batch 1 (CON-247) feat: add autobahn integration tests - batch 1 (CON-249) Apr 16, 2026
Comment thread integration_test/autobahn/scripts/autobahn_tests.sh Outdated
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",
Copy link
Copy Markdown
Contributor

@pompon0 pompon0 Apr 20, 2026

Choose a reason for hiding this comment

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

nit: given that we already run docker commands from here, would it make sense to spawn & teardown the docker cluster from go as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, changed

return 0, err
}
var parsed struct {
Response struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this type exported by sei-tendermint by any chance?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed

}
clusterSize = len(names)
// BFT tolerates f faults in a cluster of n = 3f + 1.
maxFaults = (clusterSize - 1) / 3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here we hardcode weights of the cluster. Add a TODO to address that, once custom weights are supported (or skip logging it)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

wen-coding and others added 3 commits April 20, 2026 11:46
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>
@wen-coding wen-coding added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit b42de95 Apr 21, 2026
39 checks passed
@wen-coding wen-coding deleted the wen/add_autobahn_integration_tests branch April 21, 2026 19:32
yzang2019 added a commit that referenced this pull request Apr 22, 2026
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants