Skip to content

Commit 7a863c1

Browse files
committed
t/cmd/lfstest-gitserver.go: close test servers
The lfstest-gitserver utility program used by our test suite to simulate a full Git LFS server starts a multiple HTTP server instances using the implementation provided by the Go language's "net/http/httptest" package. However, these server instances are never cleanly shut down, and while this makes no difference to the success of our test suite, the Go documentation advises that we should call the Close() method for each Server structure, so we do that now after the primary server receives a request to its "/shutdown" endpoint. We also adjust the message logged by the program upon shutdown so it is no longer prefixed with "init" but rather "close".
1 parent fdcfcbf commit 7a863c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

t/cmd/lfstest-gitserver.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ func main() {
156156
debug("init", "server client cert url: %s", serverClientCert.URL)
157157

158158
<-stopch
159-
debug("init", "git server done")
159+
server.Close()
160+
serverTLS.Close()
161+
serverClientCert.Close()
162+
debug("close", "git server done")
160163
}
161164

162165
// writeTestStateFile writes contents to either the file referenced by the

0 commit comments

Comments
 (0)