Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

increase timeout in TestConnectionsClosedIfNotAccepted on CI #85

Merged
merged 1 commit into from
Sep 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"io"
"net"
"os"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -91,9 +92,13 @@ func TestAcceptMultipleConns(t *testing.T) {
func TestConnectionsClosedIfNotAccepted(t *testing.T) {
require := require.New(t)

const timeout = 200 * time.Millisecond
var timeout = 100 * time.Millisecond
if os.Getenv("CI") != "" {
timeout = 500 * time.Millisecond
}
origAcceptTimeout := transport.AcceptTimeout
transport.AcceptTimeout = timeout
defer func() { transport.AcceptTimeout = 1 * time.Hour }()
t.Cleanup(func() { transport.AcceptTimeout = origAcceptTimeout })

id, upgrader := createUpgrader(t)
ln := createListener(t, upgrader)
Expand Down