Skip to content

Fix random CI failure for TestFeeGrant integration test#99

Merged
metalarm10 merged 4 commits into
masterfrom
john/fix-ci-random-failure-feegrant
Mar 9, 2026
Merged

Fix random CI failure for TestFeeGrant integration test#99
metalarm10 merged 4 commits into
masterfrom
john/fix-ci-random-failure-feegrant

Conversation

@metalarm10

@metalarm10 metalarm10 commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes random CI failure for upgrade integration tests, reported in https://app.clickup.com/t/868gpr0g3

TestFeeGrant sets an allowance expiration to blockTime + 10s, then calls AwaitNextBlocks(10) before pruning.
With TimeoutCommit at 500ms, 10 blocks ≈ 5-6s of chain time — not enough for expiration. Prune becomes bypassed and the assertion fails.

It's random because under heavy CI load, the blocks might be slower (pushing 10 blocks past the 10s threshold).

Proposed Solution: Fixed by replacing AwaitNextBlocks with AwaitState, which polls the latest block
timestamp until it exceeds the expiration. This guarantees the allowance is expired before pruning, regardless of block production speed.

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@metalarm10 metalarm10 requested a review from a team as a code owner March 4, 2026 10:10
@metalarm10 metalarm10 requested review from TxCorpi0x, masihyeganeh, miladz68 and ysv and removed request for a team March 4, 2026 10:10

@TxCorpi0x TxCorpi0x left a comment

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.

@TxCorpi0x made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on masihyeganeh, metalarm10, miladz68, and ysv).


integration-tests/modules/feegrant_test.go line 112 at r1 (raw file):

		}
		if !header.Time.After(allowanceExpiration) {
			return retry.Retryable(errors.Errorf(

Instead of retrying, can't we check before expiration? so we don't need the retry then

		if header.Time.Before(expirationTime) {
			return Err
		}

@metalarm10 metalarm10 left a comment

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.

@metalarm10 made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on masihyeganeh, miladz68, TxCorpi0x, and ysv).


integration-tests/modules/feegrant_test.go line 112 at r1 (raw file):

Previously, TxCorpi0x wrote…

Instead of retrying, can't we check before expiration? so we don't need the retry then

		if header.Time.Before(expirationTime) {
			return Err
		}

Done.

@TxCorpi0x TxCorpi0x left a comment

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.

@TxCorpi0x reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on masihyeganeh, miladz68, and ysv).

@miladz68 miladz68 left a comment

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.

@miladz68 reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on masihyeganeh and ysv).

@metalarm10 metalarm10 merged commit 04a292c into master Mar 9, 2026
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants