Skip to content

Conversation

@alarso16
Copy link
Contributor

@alarso16 alarso16 commented Nov 4, 2025

Why this should be merged

This cherry-picks ava-labs/coreth#1363 and ava-labs/coreth#1384, since they are very similar. They can be reviewed by commit if one prefers, but the diff for the second PR is extremely minimal (comments and t.Skip)

How this works

Same as in coreth

How this was tested

UT

Need to be documented?

No

Need to update RELEASES.md?

No

@alarso16 alarso16 self-assigned this Nov 4, 2025
@alarso16 alarso16 added flaky-test Test failing occasionally coreth sync labels Nov 4, 2025
@alarso16 alarso16 marked this pull request as ready for review November 4, 2025 16:01
@alarso16 alarso16 requested a review from a team as a code owner November 4, 2025 16:01
@JonathanOppenheimer JonathanOppenheimer changed the title test: Fix rpc flakes sync: coreth PR #1363,1384: test: Fix rpc flakes Nov 4, 2025
opts = append(opts, WithWebsocketMessageSizeLimit(*limit))
if *limit > 0 {
expLimit = *limit // 0 means infinite
for _, tt := range []struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: please extract the anonymous struct as a variable called tests and use named fields when creating instances of it. Let's stick to one way of declaring parameters for table driven tests. avalanchego also insist on this specific way of declaring them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want to change geth code

testLimit(ptr(wsDefaultReadLimit + 1024))
var res string
err = client.Call(&res, "test_repeat", "A", tt.size)
if tt.err && err == nil {
Copy link
Contributor

@powerslider powerslider Nov 14, 2025

Choose a reason for hiding this comment

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

why not use require from testify here and the lines below?

Copy link
Contributor

Choose a reason for hiding this comment

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

because these are tests from geth packages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

rpc/main_test.go Outdated
Comment on lines 38 to 48
customtypes.Register()

// Since there are so many flaky tests in the RPC package, we run the tests
// multiple times to try to get a passing run.
var code int
for range 5 {
code = m.Run()
if code == 0 {
break
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we doing this if we skip flaky ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point, I'll remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coreth sync flaky-test Test failing occasionally

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants