internal: fix flaky test KeepaliveClientStaysHealthyWithResponsiveServer (#4427)
Server should allow `NoStream`, otherwise there's a small chance (5/1000) the connection will be closed due to `too many pings`.
This commit is contained in:
Родитель
6fea90d7a8
Коммит
a16b156e99
|
@ -346,12 +346,19 @@ func (s) TestKeepaliveClientClosesWithActiveStreams(t *testing.T) {
|
||||||
// responds to keepalive pings, and makes sure than a client transport stays
|
// responds to keepalive pings, and makes sure than a client transport stays
|
||||||
// healthy without any active streams.
|
// healthy without any active streams.
|
||||||
func (s) TestKeepaliveClientStaysHealthyWithResponsiveServer(t *testing.T) {
|
func (s) TestKeepaliveClientStaysHealthyWithResponsiveServer(t *testing.T) {
|
||||||
server, client, cancel := setUpWithOptions(t, 0, &ServerConfig{}, normal, ConnectOptions{
|
server, client, cancel := setUpWithOptions(t, 0,
|
||||||
KeepaliveParams: keepalive.ClientParameters{
|
&ServerConfig{
|
||||||
Time: 1 * time.Second,
|
KeepalivePolicy: keepalive.EnforcementPolicy{
|
||||||
Timeout: 1 * time.Second,
|
PermitWithoutStream: true,
|
||||||
PermitWithoutStream: true,
|
},
|
||||||
}})
|
},
|
||||||
|
normal,
|
||||||
|
ConnectOptions{
|
||||||
|
KeepaliveParams: keepalive.ClientParameters{
|
||||||
|
Time: 1 * time.Second,
|
||||||
|
Timeout: 1 * time.Second,
|
||||||
|
PermitWithoutStream: true,
|
||||||
|
}})
|
||||||
defer func() {
|
defer func() {
|
||||||
client.Close(fmt.Errorf("closed manually by test"))
|
client.Close(fmt.Errorf("closed manually by test"))
|
||||||
server.stop()
|
server.stop()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче