-
Notifications
You must be signed in to change notification settings - Fork 276
sync: coreth PR #1363,1384: test: Fix rpc flakes #1833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Austin Larson <[email protected]> Co-authored-by: Stephen Buttolph <[email protected]>
| opts = append(opts, WithWebsocketMessageSizeLimit(*limit)) | ||
| if *limit > 0 { | ||
| expLimit = *limit // 0 means infinite | ||
| for _, tt := range []struct { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
| 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 | ||
| } | ||
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
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