Skip to content

Commit c596555

Browse files
mergify[bot]rootulpclaude
authored
fix: increase testnode network retries and add backoff (backport #6968) (#7114)
## Summary - Increase `NewNetwork` max retries from 3 to 5 to give CI runners more chances to find free ports - Replace fixed 1s sleep with linear backoff (1s, 2s, 3s, 4s, 5s) between retries - Add a log line on each retry attempt for better CI debuggability Addresses flaky CI failure in `TestTxClientTestSuite/TestMultiConnBroadcast` where port binding errors exhausted all retry attempts: https://github.com/celestiaorg/celestia-app/actions/runs/24018301319/job/70041920378 ## Backport notes Mergify left literal `<<<<<<< HEAD` / `>>>>>>>` markers in `test/util/testnode/network.go` because v8.x reorganized the retry loop so that `cleanup()` runs inside the `isPortBindingError` branch (vs. outside it on `main`). Conflict resolved by keeping the v8.x structure and layering the new log line + linear backoff on top. ## Test plan - [x] `go build ./test/util/testnode/...` compiles successfully - [ ] CI passes on this PR 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <a href="https://app.devin.ai/review/celestiaorg/celestia-app/pull/6968" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <hr>This is an automatic backport of pull request #6968 done by [Mergify](https://mergify.com). <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/celestiaorg/celestia-app/pull/7114" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1"> <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open with Devin"> </picture> </a> <!-- devin-review-badge-end --> --------- Co-authored-by: Rootul P <rootulp@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d8cd00c commit c596555

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/util/testnode/network.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
// addresses. Configured genesis options will be applied after all accounts have
2121
// been initialized.
2222
func NewNetwork(t testing.TB, config *Config) (cctx Context, rpcAddr, grpcAddr string) {
23-
return NewNetworkWithRetry(t, config, 3)
23+
return NewNetworkWithRetry(t, config, 5)
2424
}
2525

2626
// NewNetworkWithRetry creates a testnode network with port retry logic
@@ -34,7 +34,8 @@ func NewNetworkWithRetry(t testing.TB, config *Config, maxRetries int) (cctx Con
3434
if cleanup != nil {
3535
cleanup()
3636
}
37-
time.Sleep(time.Second)
37+
t.Logf("port binding error on attempt %d/%d, retrying after %ds: %v", attempt+1, maxRetries, attempt+1, err)
38+
time.Sleep(time.Duration(attempt+1) * time.Second)
3839
config.TmConfig.RPC.ListenAddress = fmt.Sprintf("tcp://127.0.0.1:%d", MustGetFreePort())
3940
config.TmConfig.P2P.ListenAddress = fmt.Sprintf("tcp://127.0.0.1:%d", MustGetFreePort())
4041
config.TmConfig.RPC.GRPCListenAddress = fmt.Sprintf("tcp://127.0.0.1:%d", MustGetFreePort())

0 commit comments

Comments
 (0)