File tree Expand file tree Collapse file tree
clients/githubrepo/roundtripper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import (
2222)
2323
2424func TestRoundTrip (t * testing.T ) {
25+ t .Parallel ()
2526 var requestCount int
2627 ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
2728 // Customize the response headers and body based on the test scenario
@@ -38,7 +39,7 @@ func TestRoundTrip(t *testing.T) {
3839 w .Write ([]byte ("Success" )) // nolint: errcheck
3940 } else {
4041 // First request: Return Retry-After header
41- w .Header ().Set ("Retry-After" , "5 " )
42+ w .Header ().Set ("Retry-After" , "1 " )
4243 w .WriteHeader (http .StatusTooManyRequests )
4344 w .Write ([]byte ("Rate Limit Exceeded" )) // nolint: errcheck
4445 }
@@ -48,7 +49,9 @@ func TestRoundTrip(t *testing.T) {
4849 w .Write ([]byte ("Success" )) // nolint: errcheck
4950 }
5051 }))
51- defer ts .Close ()
52+ t .Cleanup (func () {
53+ defer ts .Close ()
54+ })
5255
5356 // Create the rateLimitTransport with the test server as the inner transport and a default logger
5457 transport := & rateLimitTransport {
You can’t perform that action at this time.
0 commit comments