Skip to content

Commit

Permalink
autocert: fix flaky test (#3591)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdoxsey committed Aug 30, 2022
1 parent e5ac784 commit 8713108
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/autocert/manager_test.go
Expand Up @@ -262,12 +262,15 @@ func TestConfig(t *testing.T) {
var initialOCSPStaple []byte
var certValidTime *time.Time
mgr.OnConfigChange(ctx, func(ctx context.Context, cfg *config.Config) {
log.Info(ctx).Msg("OnConfigChange")
if len(cfg.AutoCertificates) == 0 {
return
}

cert := cfg.AutoCertificates[0]
if initialOCSPStaple == nil {
initialOCSPStaple = cert.OCSPStaple
} else {
if bytes.Compare(initialOCSPStaple, cert.OCSPStaple) != 0 {
if !bytes.Equal(initialOCSPStaple, cert.OCSPStaple) {
log.Info(ctx).Msg("OCSP updated")
ocspUpdated <- true
}
Expand Down

0 comments on commit 8713108

Please sign in to comment.