From 8f67b0e4f85c61250650e2e299abf09dc4f7c1cb Mon Sep 17 00:00:00 2001 From: Hemanth Sai Maheswarla Date: Sat, 17 Feb 2024 12:16:16 +0530 Subject: [PATCH] fixing intermittent lifecycle_expiration_header failures(2!=1) beacause of datetime.now() on different timezone Signed-off-by: Hemanth Sai Maheswarla --- s3tests_boto3/functional/test_s3.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3tests_boto3/functional/test_s3.py b/s3tests_boto3/functional/test_s3.py index 05fdb9c..5270a41 100644 --- a/s3tests_boto3/functional/test_s3.py +++ b/s3tests_boto3/functional/test_s3.py @@ -9659,7 +9659,7 @@ def test_lifecycle_expiration_header_put(): bucket_name = get_new_bucket() client = get_client() - now = datetime.datetime.now(None) + now = datetime.datetime.utcnow() response = setup_lifecycle_expiration( client, bucket_name, 'rule1', 1, 'days1/') eq(check_lifecycle_expiration_header(response, now, 'rule1', 1), True) @@ -9673,7 +9673,7 @@ def test_lifecycle_expiration_header_head(): bucket_name = get_new_bucket() client = get_client() - now = datetime.datetime.now(None) + now = datetime.datetime.utcnow() response = setup_lifecycle_expiration( client, bucket_name, 'rule1', 1, 'days1/')