0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-27 23:03:37 -05:00
This commit is contained in:
a 2024-06-18 20:14:51 -05:00
parent b491fc5d6c
commit 41a4320fd3
No known key found for this signature in database
GPG key ID: 374BC539FE795AF0
2 changed files with 3 additions and 5 deletions

View file

@ -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

View file

@ -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