Skip to content

Commit

Permalink
attack: Improve reliability of TestClient
Browse files Browse the repository at this point in the history
  • Loading branch information
tsenart committed Oct 10, 2018
1 parent f25ac6a commit a3ce5a2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/attack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ func TestClient(t *testing.T) {
client := &http.Client{
Timeout: time.Duration(1 * time.Nanosecond),
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: dialer.Dial,
Proxy: http.ProxyFromEnvironment,
Dial: dialer.Dial,
ResponseHeaderTimeout: DefaultTimeout,
TLSClientConfig: DefaultTLSConfig,
TLSHandshakeTimeout: 10 * time.Second,
Expand All @@ -289,7 +289,9 @@ func TestClient(t *testing.T) {
}

server := httptest.NewServer(
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}),
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
select {}
}),
)
defer server.Close()

Expand Down

0 comments on commit a3ce5a2

Please sign in to comment.