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

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
  • Loading branch information
Lucas Rodriguez authored and AustinAbro321 committed Jul 23, 2024
1 parent c6b324d commit ac2ca51
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 ac2ca51

Please sign in to comment.