diff options
author | Rob Mulholand <rmulholand@8thlight.com> | 2019-06-24 18:43:18 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2019-06-24 18:43:18 +0800 |
commit | 98099d6fa789b5f4259f307fd7529f49e8edc8e5 (patch) | |
tree | 08b085ea0f0ba0e882678b569e584270876c5b35 | |
parent | 92a90d75782e359622a21317847c9d441abe3cd7 (diff) | |
download | go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.tar go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.tar.gz go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.tar.bz2 go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.tar.lz go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.tar.xz go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.tar.zst go-tangerine-98099d6fa789b5f4259f307fd7529f49e8edc8e5.zip |
rpc: fix subscription buffer documentation and test (#19747)
This PR updates a comment about the maximum client subscription buffer
to reflect changes made previously, and fixes a test that wouldn't fail
when wantError == true but execution did not return an error.
-rw-r--r-- | rpc/client.go | 2 | ||||
-rw-r--r-- | rpc/client_test.go | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/rpc/client.go b/rpc/client.go index 16511747f..2053f5406 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -412,7 +412,7 @@ func (c *Client) ShhSubscribe(ctx context.Context, channel interface{}, args ... // The context argument cancels the RPC request that sets up the subscription but has no // effect on the subscription after Subscribe has returned. // -// Slow subscribers will be dropped eventually. Client buffers up to 8000 notifications +// Slow subscribers will be dropped eventually. Client buffers up to 20000 notifications // before considering the subscriber dead. The subscription Err channel will receive // ErrSubscriptionQueueOverflow. Use a sufficiently large buffer on the channel or ensure // that the channel usually has at least one reader to prevent this issue. diff --git a/rpc/client_test.go b/rpc/client_test.go index 80fe29f82..759933f8c 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -374,10 +374,13 @@ func TestClientNotificationStorm(t *testing.T) { return } } + if wantError { + t.Fatalf("didn't get expected error") + } } doTest(8000, false) - doTest(10000, true) + doTest(21000, true) } func TestClientHTTP(t *testing.T) { |