Skip to content

eth: deflake TestSendTx - #2471

Open
aristide-bayard wants to merge 1 commit into
0xPolygon:developfrom
aristide-bayard:aristide-bayard/deflake-sendtx-adoption-tests
Open

aristide-bayard wants to merge 1 commit into
0xPolygon:developfrom
aristide-bayard:aristide-bayard/deflake-sendtx-adoption-tests

Conversation

@aristide-bayard

@aristide-bayard aristide-bayard commented Oct 2, 2026 •

Copy link
Copy Markdown

Summary

Deflakes TestSendTx (eth/api_backend_test.go), which races against background work and fails under CPU starvation (reproduced locally at 100% by pinning the test process to a single core shared with a busy loop).

SendTx adds to the pool with sync=false, so txA may still be queued when txB arrives. checkDelegationLimit then sees no pending list for the sender and returns ErrOutOfOrderTxFromDelegated instead of ErrInflightTxLimitReached. The test now waits for txA to be promoted before sending txB.

Test-only change, no production code touched.

The TestBuildStartDiscardsSupersededBuffer part of the original PR was dropped: #2492 (v2.10.3) already fixes that flake with waitReadPath.

Executed tests

# starvation repro (before: 11/60 failures, after: 0)
taskset -c 0 sh -c 'yes > /dev/null' &
taskset -c 0 go test -count=60 -short -cpu 1 -run 'TestSendTx$' ./eth/
go test -count=10 -short -race -run 'TestSendTx$' ./eth/

# after rebase on develop
go test -count=3 -run 'TestSendTx$' ./eth/

Rollout notes

Not consensus-affecting, no operator-facing change. Retargeted to develop as requested. Commits are not GPG-signed (external contributor).

@aristide-bayard
aristide-bayard marked this pull request as ready for review October 2, 2026 07:59

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@aristide-bayard
aristide-bayard force-pushed the aristide-bayard/deflake-sendtx-adoption-tests branch from d953c57 to 9a11269 Compare October 15, 2026 12:36
@aristide-bayard

Copy link
Copy Markdown
Author

Hi @pratikspatil024, could you take a look at this one when you get a chance? It's rebased on the latest master. Thanks!

@pratikspatil024

pratikspatil024 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Hey, please raise it against develop.
You can just update this PR itself

TestSendTx races against background work and fails under CPU starvation
(reproduced locally by pinning the test to a core shared with a busy loop):
SendTx adds to the pool with sync=false, so txA may still be queued when
txB arrives. checkDelegationLimit then sees no pending list and returns the
gapped-nonce error instead of the in-flight limit. Wait for txA to be
promoted before sending txB.
@aristide-bayard
aristide-bayard force-pushed the aristide-bayard/deflake-sendtx-adoption-tests branch from 9a11269 to 1d61f1a Compare October 16, 2026 14:12
@socket-security

Copy link
Copy Markdown

@aristide-bayard aristide-bayard changed the title eth, eth/sequencer: deflake TestSendTx and TestBuildStartDiscardsSupersededBuffer eth: deflake TestSendTx Oct 16, 2026
@aristide-bayard
aristide-bayard changed the base branch from master to develop October 16, 2026 14:14
@aristide-bayard

Copy link
Copy Markdown
Author

@pratikspatil024 done: rebased on develop and retargeted. I also dropped the TestBuildStartDiscardsSupersededBuffer part since #2492 already fixes that flake with waitReadPath; only the TestSendTx change remains.

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