]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
fix and remark on test_lifecycle_expiration_days0
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 11 Sep 2020 14:17:39 +0000 (10:17 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 11 Sep 2020 14:43:14 +0000 (10:43 -0400)
1. fix a python3-related KeyError exception

2. note here:  AWS documentation includes examples of "Days 0"
   in use, but boto3 will not accept them--this is why the days0
   test currently sets Days 1

3. delay increased to 30s, to avoid occasional failures due to
   jitter

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
s3tests_boto3/functional/test_s3.py

index 969d28fd51f20a2bb330e0881b46a99b2e22b0d5..3fa7657434e155e1b8a9168715649346a300dc42 100644 (file)
@@ -9128,14 +9128,17 @@ def test_lifecycle_expiration_days0():
 
     rules=[{'Expiration': {'Days': 1}, 'ID': 'rule1', 'Prefix': 'days0/', 'Status':'Enabled'}]
     lifecycle = {'Rules': rules}
-    print(lifecycle)
+
     response = client.put_bucket_lifecycle_configuration(Bucket=bucket_name, LifecycleConfiguration=lifecycle)
     eq(response['ResponseMetadata']['HTTPStatusCode'], 200)
 
-    time.sleep(20)
+    time.sleep(30)
 
     response = client.list_objects(Bucket=bucket_name)
-    expire_objects = response['Contents']
+    try:
+        expire_objects = response['Contents']
+    except KeyError:
+        expire_objects = []
 
     eq(len(expire_objects), 0)