Skip to content

Commit

Permalink
test: shutdown http test servers (#2559)
Browse files Browse the repository at this point in the history
## Description
Shutdown HTTP test servers with `Close()`

## Related Issue
Noticed we aren't shutting down HTTP test servers in a couple of our
unit tests while working on #2558

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/.github/CONTRIBUTING.md#developer-workflow)
followed
  • Loading branch information
Lucas Rodriguez committed May 30, 2024
1 parent c09cac5 commit 9da7406
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pkg/packager/sources/new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func TestPackageSource(t *testing.T) {
defer f.Close()
io.Copy(rw, f)
}))
t.Cleanup(func() { ts.Close() })

tests := []struct {
name string
Expand Down
1 change: 1 addition & 0 deletions src/pkg/utils/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func TestDownloadToFile(t *testing.T) {
}
rw.Write([]byte(content))
}))
t.Cleanup(func() { srv.Close() })

tests := []struct {
name string
Expand Down

0 comments on commit 9da7406

Please sign in to comment.