impl connection recovery
This commit is contained in:
+10
-3
@@ -22,13 +22,19 @@ func startClient(t *testing.T, hubAddr, psk string, maxConn int, mappings []clie
|
||||
// tests that need liveness detection to trigger quickly.
|
||||
func startClientWithPing(t *testing.T, hubAddr, psk string, maxConn, pingMs int, mappings []client.Mapping) *client.Client {
|
||||
t.Helper()
|
||||
cfg := &client.Config{
|
||||
return startClientCfg(t, &client.Config{
|
||||
Server: hubAddr,
|
||||
PSK: psk,
|
||||
MaxConn: maxConn,
|
||||
PingIntervalMs: pingMs,
|
||||
Mappings: mappings,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// startClientCfg runs an in-process client from a fully-specified config, for
|
||||
// tests that need a knob the shorthand helpers do not expose.
|
||||
func startClientCfg(t *testing.T, cfg *client.Config) *client.Client {
|
||||
t.Helper()
|
||||
c := client.New(cfg)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
t.Cleanup(func() {
|
||||
@@ -142,7 +148,8 @@ func TestLargeTransfer(t *testing.T) {
|
||||
}
|
||||
|
||||
// TestConcurrentStreamsUseMultipleConns confirms the least-loaded allocator
|
||||
// opens additional worker connections once streams saturate (>8).
|
||||
// grows the pool breadth-first: concurrent streams spread over several worker
|
||||
// connections rather than stacking on one, without ever exceeding maxConn.
|
||||
func TestConcurrentStreamsUseMultipleConns(t *testing.T) {
|
||||
const psk = "e2e-concurrent"
|
||||
const n = 20
|
||||
|
||||
Reference in New Issue
Block a user