diff options
author | a <[email protected]> | 2024-06-18 20:14:51 -0500 |
---|---|---|
committer | a <[email protected]> | 2024-06-18 20:14:51 -0500 |
commit | 41a4320fd34010e53835f4e26f5729aa5f220545 (patch) | |
tree | 863c25be21547aaa98af96062a316176a482303a | |
parent | b491fc5d6ce68eb4630e950fa514575965172682 (diff) | |
download | caddy-41a4320fd34010e53835f4e26f5729aa5f220545.tar.gz caddy-41a4320fd34010e53835f4e26f5729aa5f220545.zip |
noot
-rw-r--r-- | caddytest/caddytest.go | 5 | ||||
-rw-r--r-- | caddytest/caddytest_assert.go | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/caddytest/caddytest.go b/caddytest/caddytest.go index 44ae991ee..a1ec97048 100644 --- a/caddytest/caddytest.go +++ b/caddytest/caddytest.go @@ -93,7 +93,6 @@ func (tc *Tester) CleanupCaddy() error { if err != nil { return fmt.Errorf("couldn't stop caddytest server: %w", err) } - time.Sleep(200 * time.Millisecond) for retries := 0; retries < 10; retries++ { if isCaddyAdminRunning() != nil { return nil @@ -206,8 +205,8 @@ func (tc *Tester) startServer() error { caddycmd.Main() }() // wait for caddy admin api to start. it should happen quickly. - for retries := 3; retries > 0 && isCaddyAdminRunning() != nil; retries-- { - time.Sleep(1 * time.Second) + for retries := 10; retries > 0 && isCaddyAdminRunning() != nil; retries-- { + time.Sleep(100 * time.Millisecond) } // one more time to return the error diff --git a/caddytest/caddytest_assert.go b/caddytest/caddytest_assert.go index cfb019356..8587abaed 100644 --- a/caddytest/caddytest_assert.go +++ b/caddytest/caddytest_assert.go @@ -24,8 +24,7 @@ func AssertLoadError(t *testing.T, rawConfig string, configType string, expected if !strings.Contains(err.Error(), expectedError) { t.Errorf("expected error \"%s\" but got \"%s\"", expectedError, err.Error()) } - err = tc.CleanupCaddy() - require.NoError(t, err) + tc.CleanupCaddy() } // CompareAdapt adapts a config and then compares it against an expected result |