Skip to content

Commit 953382f

Browse files
authored
fix: Close httptest server to prevent test flakiness (#4210)
1 parent 9562430 commit 953382f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

github/github_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ func TestWithAuthToken(t *testing.T) {
477477
gotReq = true
478478
headerVal = r.Header.Get("Authorization")
479479
}))
480+
t.Cleanup(srv.Close)
480481
_, err := c.Get(srv.URL)
481482
assertNilError(t, err)
482483
if !gotReq {
@@ -517,6 +518,7 @@ func TestWithAuthToken(t *testing.T) {
517518
gotReq = true
518519
_, ifAuthorizationSet = r.Header["Authorization"]
519520
}))
521+
t.Cleanup(srv.Close)
520522
_, err := c.client.Get(srv.URL)
521523
assertNilError(t, err)
522524
if !gotReq {

0 commit comments

Comments
 (0)