Skip to content

Commit 0cefa84

Browse files
rootulpclaude
andauthored
fix: add WaitForNextBlock to prevent flaky testnode tests (#7046)
## Summary - Add missing `cctx.WaitForNextBlock()` calls after `testnode.NewNetwork` in three tests that were susceptible to flaking when the node hadn't produced its first block - Affected tests: `TestClaimRewardsAfterFullUndelegation`, `StandardSDKIntegrationTestSuite.SetupSuite`, `TestTimeInPrepareProposalContext` - Matches the pattern already used by non-flaky tests like `integration_test.go` and `send_to_self_test.go` Closes #7045 ## Test plan - [x] `TestClaimRewardsAfterFullUndelegation` passes 3/3 runs locally with `-count=3` - [ ] `test / test-short` CI job passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- devin-review-badge-begin --> --- <a href="https://app.devin.ai/review/celestiaorg/celestia-app/pull/7046" 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: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b62ece2 commit 0cefa84

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

app/test/claim_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func TestClaimRewardsAfterFullUndelegation(t *testing.T) {
2929
accounts := testfactory.GenerateAccounts(2)
3030
config := testnode.DefaultConfig().WithFundedAccounts(accounts...)
3131
cctx, _, _ := testnode.NewNetwork(t, config)
32+
require.NoError(t, cctx.WaitForNextBlock())
3233

3334
txClient, err := testnode.NewTxClientFromContext(cctx)
3435
require.NoError(t, err)

app/test/prepare_proposal_context_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func TestTimeInPrepareProposalContext(t *testing.T) {
3535
vestAccName := "vesting"
3636
cfg := testnode.DefaultConfig().WithFundedAccounts(sendAccName)
3737
cctx, _, _ := testnode.NewNetwork(t, cfg)
38+
require.NoError(t, cctx.WaitForNextBlock())
3839
enc := encoding.MakeConfig(app.ModuleEncodingRegisters...)
3940

4041
type test struct {

app/test/std_sdk_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func (s *StandardSDKIntegrationTestSuite) SetupSuite() {
6666
s.accounts = testfactory.GenerateAccounts(35)
6767
s.cfg = testnode.DefaultConfig().WithFundedAccounts(s.accounts...)
6868
s.cctx, _, _ = testnode.NewNetwork(t, s.cfg)
69+
require.NoError(t, s.cctx.WaitForNextBlock())
6970
s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...)
7071
}
7172

0 commit comments

Comments
 (0)