Skip to content

Commit

Permalink
fix: close http server after use on test
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Sep 20, 2023
1 parent 91a7f21 commit 2e06a80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/internal/itest/trustless_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func TestTrustlessUnixfsFetch(t *testing.T) {
go func() {
serverError <- httpServer.Start()
}()
defer httpServer.Close()
responseChan := make(chan *http.Response, 1)
go func() {
// Make a request for our CID and read the complete CAR bytes
Expand Down
3 changes: 1 addition & 2 deletions pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ func (s *HttpServer) Start() error {
logger.Errorw("failed to start http server", "err", err)
return err
}

return nil
}

// Close shutsdown the server and cancels the server context
// Close shuts down the server and cancels the server context
func (s *HttpServer) Close() error {
logger.Info("closing http server")
s.cancel()
Expand Down

0 comments on commit 2e06a80

Please sign in to comment.