From da8b7fe58f83012d9a6c6e15cb249ca5f476597c Mon Sep 17 00:00:00 2001 From: Matt Holt Date: Mon, 19 Sep 2022 21:54:47 -0600 Subject: caddyhttp: Honor grace period in background (#5043) * caddyhttp: Honor grace period in background This avoids blocking during config reloads. * Don't quit process until servers shut down * Make tests more likely to pass on fast CI (#5045) * caddyhttp: Even faster shutdowns Simultaneously shut down all HTTP servers, rather than one at a time. In practice there usually won't be more than 1 that lingers. But this code ensures that they all Shutdown() in their own goroutine and then we wait for them at the end (if exiting). We also wait for them to start up so we can be fairly confident the shutdowns have begun; i.e. old servers no longer accepting new connections. * Fix comment typo * Pull functions out of loop, for readability --- caddytest/caddytest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'caddytest/caddytest.go') diff --git a/caddytest/caddytest.go b/caddytest/caddytest.go index 4fb3394..e560ab4 100644 --- a/caddytest/caddytest.go +++ b/caddytest/caddytest.go @@ -43,7 +43,7 @@ type Defaults struct { // Default testing values var Default = Defaults{ - AdminPort: 2019, + AdminPort: 2999, // different from what a real server also running on a developer's machine might be Certifcates: []string{"/caddy.localhost.crt", "/caddy.localhost.key"}, TestRequestTimeout: 5 * time.Second, LoadRequestTimeout: 5 * time.Second, -- cgit v1.2.3