Skip to content

Fixed logic for test to handle cases when input exceeds wsDefaultReadLimit #32240

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rpc/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func TestWebsocketLargeRead(t *testing.T) {
// Remove some bytes for json encoding overhead.
underLimit := int(expLimit - 128)
overLimit := expLimit + 1
if expLimit == wsDefaultReadLimit {
// No point trying the full 32MB in tests. Just sanity-check that
if expLimit >= wsDefaultReadLimit {
// No point trying the full 32MB or more in the tests. Just sanity-check that
// it's not obviously limited.
underLimit = 1024
overLimit = -1
Expand All @@ -170,6 +170,7 @@ func TestWebsocketLargeRead(t *testing.T) {
testLimit(ptr(0)) // Should be ignored (use default)
testLimit(nil) // Should be ignored (use default)
testLimit(ptr(200))
testLimit(ptr(wsDefaultReadLimit))
testLimit(ptr(wsDefaultReadLimit * 2))
}

Expand Down