@@ -988,14 +988,14 @@ func testPipelineClientDo(t *testing.T, c *PipelineClient) {
988
988
time .Sleep (10 * time .Millisecond )
989
989
continue
990
990
}
991
- t .Fatalf ("unexpected error on iteration %d: %s" , i , err )
991
+ t .Errorf ("unexpected error on iteration %d: %s" , i , err )
992
992
}
993
993
if resp .StatusCode () != StatusOK {
994
- t .Fatalf ("unexpected status code: %d. Expecting %d" , resp .StatusCode (), StatusOK )
994
+ t .Errorf ("unexpected status code: %d. Expecting %d" , resp .StatusCode (), StatusOK )
995
995
}
996
996
body := string (resp .Body ())
997
997
if body != "OK" {
998
- t .Fatalf ("unexpected body: %q. Expecting %q" , body , "OK" )
998
+ t .Errorf ("unexpected body: %q. Expecting %q" , body , "OK" )
999
999
}
1000
1000
1001
1001
// sleep for a while, so the connection to the host may expire.
@@ -1705,10 +1705,10 @@ func testClientDoTimeoutError(t *testing.T, c *Client, n int) {
1705
1705
for i := 0 ; i < n ; i ++ {
1706
1706
err := c .DoTimeout (& req , & resp , time .Millisecond )
1707
1707
if err == nil {
1708
- t .Fatalf ("expecting error" )
1708
+ t .Errorf ("expecting error" )
1709
1709
}
1710
1710
if err != ErrTimeout {
1711
- t .Fatalf ("unexpected error: %s. Expecting %s" , err , ErrTimeout )
1711
+ t .Errorf ("unexpected error: %s. Expecting %s" , err , ErrTimeout )
1712
1712
}
1713
1713
}
1714
1714
}
@@ -1718,16 +1718,16 @@ func testClientGetTimeoutError(t *testing.T, c *Client, n int) {
1718
1718
for i := 0 ; i < n ; i ++ {
1719
1719
statusCode , body , err := c .GetTimeout (buf , "http://foobar.com/baz" , time .Millisecond )
1720
1720
if err == nil {
1721
- t .Fatalf ("expecting error" )
1721
+ t .Errorf ("expecting error" )
1722
1722
}
1723
1723
if err != ErrTimeout {
1724
- t .Fatalf ("unexpected error: %s. Expecting %s" , err , ErrTimeout )
1724
+ t .Errorf ("unexpected error: %s. Expecting %s" , err , ErrTimeout )
1725
1725
}
1726
1726
if statusCode != 0 {
1727
- t .Fatalf ("unexpected statusCode=%d. Expecting %d" , statusCode , 0 )
1727
+ t .Errorf ("unexpected statusCode=%d. Expecting %d" , statusCode , 0 )
1728
1728
}
1729
1729
if body == nil {
1730
- t .Fatalf ("body must be non-nil" )
1730
+ t .Errorf ("body must be non-nil" )
1731
1731
}
1732
1732
}
1733
1733
}
@@ -2326,14 +2326,14 @@ func testClientGet(t *testing.T, c clientGetter, addr string, n int) {
2326
2326
statusCode , body , err := c .Get (buf , uri )
2327
2327
buf = body
2328
2328
if err != nil {
2329
- t .Fatalf ("unexpected error when doing http request: %s" , err )
2329
+ t .Errorf ("unexpected error when doing http request: %s" , err )
2330
2330
}
2331
2331
if statusCode != StatusOK {
2332
- t .Fatalf ("unexpected status code: %d. Expecting %d" , statusCode , StatusOK )
2332
+ t .Errorf ("unexpected status code: %d. Expecting %d" , statusCode , StatusOK )
2333
2333
}
2334
2334
resultURI := string (body )
2335
2335
if resultURI != uri {
2336
- t .Fatalf ("unexpected uri %q. Expecting %q" , resultURI , uri )
2336
+ t .Errorf ("unexpected uri %q. Expecting %q" , resultURI , uri )
2337
2337
}
2338
2338
}
2339
2339
}
@@ -2346,17 +2346,17 @@ func testClientDoTimeoutSuccess(t *testing.T, c *Client, addr string, n int) {
2346
2346
uri := fmt .Sprintf ("%s/foo/%d?bar=baz" , addr , i )
2347
2347
req .SetRequestURI (uri )
2348
2348
if err := c .DoTimeout (& req , & resp , time .Second ); err != nil {
2349
- t .Fatalf ("unexpected error: %s" , err )
2349
+ t .Errorf ("unexpected error: %s" , err )
2350
2350
}
2351
2351
if resp .StatusCode () != StatusOK {
2352
- t .Fatalf ("unexpected status code: %d. Expecting %d" , resp .StatusCode (), StatusOK )
2352
+ t .Errorf ("unexpected status code: %d. Expecting %d" , resp .StatusCode (), StatusOK )
2353
2353
}
2354
2354
resultURI := string (resp .Body ())
2355
2355
if strings .HasPrefix (uri , "https" ) {
2356
2356
resultURI = uri [:5 ] + resultURI [4 :]
2357
2357
}
2358
2358
if resultURI != uri {
2359
- t .Fatalf ("unexpected uri %q. Expecting %q" , resultURI , uri )
2359
+ t .Errorf ("unexpected uri %q. Expecting %q" , resultURI , uri )
2360
2360
}
2361
2361
}
2362
2362
}
@@ -2368,17 +2368,17 @@ func testClientGetTimeoutSuccess(t *testing.T, c *Client, addr string, n int) {
2368
2368
statusCode , body , err := c .GetTimeout (buf , uri , time .Second )
2369
2369
buf = body
2370
2370
if err != nil {
2371
- t .Fatalf ("unexpected error when doing http request: %s" , err )
2371
+ t .Errorf ("unexpected error when doing http request: %s" , err )
2372
2372
}
2373
2373
if statusCode != StatusOK {
2374
- t .Fatalf ("unexpected status code: %d. Expecting %d" , statusCode , StatusOK )
2374
+ t .Errorf ("unexpected status code: %d. Expecting %d" , statusCode , StatusOK )
2375
2375
}
2376
2376
resultURI := string (body )
2377
2377
if strings .HasPrefix (uri , "https" ) {
2378
2378
resultURI = uri [:5 ] + resultURI [4 :]
2379
2379
}
2380
2380
if resultURI != uri {
2381
- t .Fatalf ("unexpected uri %q. Expecting %q" , resultURI , uri )
2381
+ t .Errorf ("unexpected uri %q. Expecting %q" , resultURI , uri )
2382
2382
}
2383
2383
}
2384
2384
}
@@ -2394,14 +2394,14 @@ func testClientPost(t *testing.T, c clientPoster, addr string, n int) {
2394
2394
statusCode , body , err := c .Post (buf , uri , & args )
2395
2395
buf = body
2396
2396
if err != nil {
2397
- t .Fatalf ("unexpected error when doing http request: %s" , err )
2397
+ t .Errorf ("unexpected error when doing http request: %s" , err )
2398
2398
}
2399
2399
if statusCode != StatusOK {
2400
- t .Fatalf ("unexpected status code: %d. Expecting %d" , statusCode , StatusOK )
2400
+ t .Errorf ("unexpected status code: %d. Expecting %d" , statusCode , StatusOK )
2401
2401
}
2402
2402
s := string (body )
2403
2403
if s != argsS {
2404
- t .Fatalf ("unexpected response %q. Expecting %q" , s , argsS )
2404
+ t .Errorf ("unexpected response %q. Expecting %q" , s , argsS )
2405
2405
}
2406
2406
}
2407
2407
}
0 commit comments