fix race in TestComputeActions test (#13564)

This commit is contained in:
Poorna K 2021-11-02 17:20:15 -04:00 committed by GitHub
parent 73b74c94a1
commit 3dfcca68e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -394,17 +394,17 @@ func TestComputeActions(t *testing.T) {
{ {
inputConfig: `<BucketLifecycleConfiguration><Rule><Filter></Filter><Status>Enabled</Status><Transition><Days>0</Days><StorageClass>S3TIER-1</StorageClass></Transition></Rule></BucketLifecycleConfiguration>`, inputConfig: `<BucketLifecycleConfiguration><Rule><Filter></Filter><Status>Enabled</Status><Transition><Days>0</Days><StorageClass>S3TIER-1</StorageClass></Transition></Rule></BucketLifecycleConfiguration>`,
objectName: "foodir/fooobject", objectName: "foodir/fooobject",
objectModTime: time.Now().UTC(), // Created now objectModTime: time.Now().Add(-1 * time.Nanosecond).UTC(), // Created now
expectedAction: TransitionAction, expectedAction: TransitionAction,
}, },
// Should transition immediately when NoncurrentVersion Transition days is zero // Should transition immediately when NoncurrentVersion Transition days is zero
{ {
inputConfig: `<BucketLifecycleConfiguration><Rule><Filter></Filter><Status>Enabled</Status><NoncurrentVersionTransition><NoncurrentDays>0</NoncurrentDays><StorageClass>S3TIER-1</StorageClass></NoncurrentVersionTransition></Rule></BucketLifecycleConfiguration>`, inputConfig: `<BucketLifecycleConfiguration><Rule><Filter></Filter><Status>Enabled</Status><NoncurrentVersionTransition><NoncurrentDays>0</NoncurrentDays><StorageClass>S3TIER-1</StorageClass></NoncurrentVersionTransition></Rule></BucketLifecycleConfiguration>`,
objectName: "foodir/fooobject", objectName: "foodir/fooobject",
objectModTime: time.Now().UTC(), // Created now objectModTime: time.Now().Add(-1 * time.Nanosecond).UTC(), // Created now
expectedAction: TransitionVersionAction, expectedAction: TransitionVersionAction,
isNoncurrent: true, isNoncurrent: true,
objectSuccessorModTime: time.Now().UTC(), objectSuccessorModTime: time.Now().Add(-1 * time.Nanosecond).UTC(),
versionID: uuid.New().String(), versionID: uuid.New().String(),
}, },
} }