@@ -17,10 +17,14 @@ func TestHTTPClientTimeout(t *testing.T) {
17
17
})
18
18
19
19
// Create a test server that introduces a delay
20
- testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
21
- time .Sleep (200 * time .Millisecond ) // Delay longer than client timeout
22
- w .WriteHeader (http .StatusOK )
23
- }))
20
+ testServer := httptest .NewServer (
21
+ http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
22
+ time .Sleep (
23
+ 200 * time .Millisecond ,
24
+ ) // Delay longer than client timeout
25
+ w .WriteHeader (http .StatusOK )
26
+ }),
27
+ )
24
28
defer testServer .Close ()
25
29
26
30
// Make a request to the test server
@@ -43,10 +47,14 @@ func TestHTTPClientTimeoutPass(t *testing.T) {
43
47
})
44
48
45
49
// Create a test server that introduces a delay
46
- testServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
47
- time .Sleep (200 * time .Millisecond ) // Delay shorter than client timeout
48
- w .WriteHeader (http .StatusOK )
49
- }))
50
+ testServer := httptest .NewServer (
51
+ http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
52
+ time .Sleep (
53
+ 200 * time .Millisecond ,
54
+ ) // Delay shorter than client timeout
55
+ w .WriteHeader (http .StatusOK )
56
+ }),
57
+ )
50
58
defer testServer .Close ()
51
59
52
60
// Make a request to the test server
0 commit comments