From 20b4573de972fee28407e027bbbd530cc9a090be Mon Sep 17 00:00:00 2001 From: Alexgao001 Date: Fri, 27 Oct 2023 17:04:50 +0800 Subject: [PATCH] fix policy key is not GC when a policy expiration time comes --- e2e/tests/permission_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e/tests/permission_test.go b/e2e/tests/permission_test.go index b0eb745fb..2bb071264 100644 --- a/e2e/tests/permission_test.go +++ b/e2e/tests/permission_test.go @@ -1942,19 +1942,20 @@ func (s *StorageTestSuite) TestExpiredPolicyGCAndRePut() { // wait for policy expired time.Sleep(5 * time.Second) - // Query the policy which is enforced on bucket and object + + // query the policy, which is already GC, should get err. queryPolicyForAccountResp, err = s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{ Resource: grn1.String(), PrincipalAddress: user1.GetAddr().String(), }) s.Require().Error(err) - // the user should be able to re-put policy for the resource. + // the user should be able to re-put policy for the bucket. msgPutBucketPolicy = storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(), principal, []*types.Statement{bucketStatement}, nil) s.SendTxBlock(owner, msgPutBucketPolicy) - // Query the policy which is enforced on bucket + // Query the policy which is enforced on bucket. queryPolicyForAccountResp, err = s.Client.QueryPolicyForAccount(ctx, &storagetypes.QueryPolicyForAccountRequest{ Resource: grn1.String(), PrincipalAddress: user1.GetAddr().String(),