Skip to content

Commit

Permalink
Charmhub: Ensure we close the testing server
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRichardson committed Jun 24, 2021
1 parent 818d2c9 commit d49a948
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charmhub/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ func (s *RESTSuite) TestGetWithFailureRetry(c *gc.C) {
called++
w.WriteHeader(http.StatusTooManyRequests)
}))
defer server.Close()

transport := RequestHTTPTransport(nil, jujuhttp.RetryPolicy{
Attempts: 3,
Expand All @@ -167,6 +168,7 @@ func (s *RESTSuite) TestGetWithFailureWithoutRetry(c *gc.C) {
called++
w.WriteHeader(http.StatusInternalServerError)
}))
defer server.Close()

transport := RequestHTTPTransport(nil, jujuhttp.RetryPolicy{
Attempts: 3,
Expand All @@ -191,6 +193,7 @@ func (s *RESTSuite) TestGetWithNoRetry(c *gc.C) {
w.WriteHeader(http.StatusOK)
fmt.Fprintln(w, "{}")
}))
defer server.Close()

transport := RequestHTTPTransport(nil, jujuhttp.RetryPolicy{
Attempts: 3,
Expand Down

0 comments on commit d49a948

Please sign in to comment.