Skip to content

Commit

Permalink
Enable new feature for specific tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgporada committed Nov 5, 2024
1 parent 5ccd589 commit 4bce078
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ra/ra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import (
"github.com/letsencrypt/boulder/ctpolicy"
"github.com/letsencrypt/boulder/ctpolicy/loglist"
berrors "github.com/letsencrypt/boulder/errors"
"github.com/letsencrypt/boulder/features"
"github.com/letsencrypt/boulder/goodkey"
bgrpc "github.com/letsencrypt/boulder/grpc"
"github.com/letsencrypt/boulder/identifier"
Expand Down Expand Up @@ -887,6 +888,9 @@ func TestPerformValidation_FailedValidationsTriggerPauseIdentifiersRatelimit(t *
va, sa, ra, redisSrc, fc, cleanUp := initAuthorities(t)
defer cleanUp()

features.Set(features.Config{UseKvLimitsForZombieClientPausing: true})
defer features.Reset()

mockSA := &mockSAPaused{}
ra.SA = mockSA

Expand Down Expand Up @@ -1001,8 +1005,8 @@ func TestPerformValidation_FailedValidationsTriggerPauseIdentifiersRatelimit(t *
test.AssertEquals(t, len(got.Identifiers), 1)
test.AssertEquals(t, got.Identifiers[0].Value, domain)

err = ra.limiter.Reset(ctx, bucketKey)
test.AssertNotError(t, err, "Failed cleaning up redis")
//err = ra.limiter.Reset(ctx, bucketKey)
//test.AssertNotError(t, err, "Failed cleaning up redis")
}

func TestPerformValidation_FailedThenSuccessfulValidationResetsPauseIdentifiersRatelimit(t *testing.T) {
Expand All @@ -1013,6 +1017,9 @@ func TestPerformValidation_FailedThenSuccessfulValidationResetsPauseIdentifiersR
va, sa, ra, redisSrc, fc, cleanUp := initAuthorities(t)
defer cleanUp()

features.Set(features.Config{UseKvLimitsForZombieClientPausing: true})
defer features.Reset()

originalSA := sa
mockSA := &mockSAPaused{}
ra.SA = mockSA
Expand Down Expand Up @@ -1155,8 +1162,8 @@ func TestPerformValidation_FailedThenSuccessfulValidationResetsPauseIdentifiersR
_, err = redisSrc.Get(ctx, bucketKey)
test.AssertErrorIs(t, err, ratelimits.ErrBucketNotFound)

err = ra.limiter.Reset(ctx, bucketKey)
test.AssertNotError(t, err, "Failed cleaning up redis")
//err = ra.limiter.Reset(ctx, bucketKey)
//test.AssertNotError(t, err, "Failed cleaning up redis")
}

func TestPerformValidationVAError(t *testing.T) {
Expand Down

0 comments on commit 4bce078

Please sign in to comment.