INNER CODE UNIT · Go
TestSessionsMaxOutRaceQueries
yahoo/vssh · client_test.go:118
func TestSessionsMaxOutRaceQueries(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
config := GetConfigUserPass("vssh", "vssh")
vs := New().StartWithContext(ctx)
vs.AddClient(testSrvAddr, config, SetMaxSessions(1), DisableRequestPty())
vs.Wait(100)
timeout, _ := time.ParseDuration("5s")
respChan1 := vs.Run(ctx, "ping", timeout)
respChan2 := vs.Run(ctx, "ping", timeout)
resp1 := <-respChan1
resp2 := <-respChan2