Browse Source

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.
Rob Mulholand 6 years ago
parent
commit
98099d6fa7
2 changed files with 5 additions and 2 deletions
  1. 1 1
      rpc/client.go
  2. 4 1
      rpc/client_test.go

+ 1 - 1
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.

+ 4 - 1
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) {