LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Tests for transport.go | 5 // Tests for transport.go |
6 | 6 |
7 package http_test | 7 package http_test |
8 | 8 |
9 import ( | 9 import ( |
10 "bytes" | 10 "bytes" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } | 383 } |
384 if body2 == body3 { | 384 if body2 == body3 { |
385 t.Errorf("expected body2 and body3 to be different") | 385 t.Errorf("expected body2 and body3 to be different") |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 // Test for http://golang.org/issue/2616 (appropriate issue number) | 389 // Test for http://golang.org/issue/2616 (appropriate issue number) |
390 // This fails pretty reliably with GOMAXPROCS=100 or something high. | 390 // This fails pretty reliably with GOMAXPROCS=100 or something high. |
391 func TestStressSurpriseServerCloses(t *testing.T) { | 391 func TestStressSurpriseServerCloses(t *testing.T) { |
392 if testing.Short() { | 392 if testing.Short() { |
393 » » t.Logf("skipping test in short mode") | 393 » » t.Skip("skipping test in short mode") |
394 » » return | |
395 } | 394 } |
396 ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request)
{ | 395 ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request)
{ |
397 w.Header().Set("Content-Length", "5") | 396 w.Header().Set("Content-Length", "5") |
398 w.Header().Set("Content-Type", "text/plain") | 397 w.Header().Set("Content-Type", "text/plain") |
399 w.Write([]byte("Hello")) | 398 w.Write([]byte("Hello")) |
400 w.(Flusher).Flush() | 399 w.(Flusher).Flush() |
401 conn, buf, _ := w.(Hijacker).Hijack() | 400 conn, buf, _ := w.(Hijacker).Hijack() |
402 buf.Flush() | 401 buf.Flush() |
403 conn.Close() | 402 conn.Close() |
404 })) | 403 })) |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, | 1205 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, |
1207 0x17, 0x00, 0xe8, 0xff, 0x42, 0x12, 0x46, 0x16, | 1206 0x17, 0x00, 0xe8, 0xff, 0x42, 0x12, 0x46, 0x16, |
1208 0x06, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, | 1207 0x06, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, |
1209 0x00, 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, | 1208 0x00, 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, |
1210 0x00, 0x00, 0x00, 0x42, 0x12, 0x46, 0x16, 0x06, | 1209 0x00, 0x00, 0x00, 0x42, 0x12, 0x46, 0x16, 0x06, |
1211 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, 0x00, | 1210 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x08, 0x00, |
1212 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00, | 1211 0xf7, 0xff, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00, |
1213 0x00, 0x00, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00, | 1212 0x00, 0x00, 0x3d, 0xb1, 0x20, 0x85, 0xfa, 0x00, |
1214 0x00, 0x00, | 1213 0x00, 0x00, |
1215 } | 1214 } |
LEFT | RIGHT |