amogh-jahagirdar commented on code in PR #6703:
URL: https://github.com/apache/iceberg/pull/6703#discussion_r1090884952


##########
python/tests/catalog/test_glue.py:
##########
@@ -67,7 +67,18 @@ def get_random_databases(n: int) -> Set[str]:
 
 @pytest.fixture(name="_bucket_initialize")
 def fixture_s3_bucket(_s3) -> None:  # type: ignore
-    _s3.create_bucket(Bucket=BUCKET_NAME)
+    bucket = _s3.create_bucket(Bucket=BUCKET_NAME)
+    yield bucket
+
+    response = _s3.list_objects_v2(
+        Bucket=BUCKET_NAME,
+    )
+    while response["KeyCount"] > 0:
+        _s3.delete_objects(Bucket=BUCKET_NAME, Delete={"Objects": [{"Key": 
obj["Key"]} for obj in response["Contents"]]})

Review Comment:
   I haven't checked the details of this test, but delete_objects only accepts 
1000 keys at a time for a given bucket. We're probably not creating close to 
that much here which is why this is passing, but just so the logic is robust we 
probably want to handle that (if not here, we can do in a separate PR as well)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to