From 72af4f11a122d9642a07c9bd12a67a3ca725712a Mon Sep 17 00:00:00 2001 From: George Hotz Date: Sun, 21 Nov 2021 21:29:22 -0800 Subject: [PATCH] AWS_EC2_METADATA_DISABLED took 2 hours to find --- tools/s3test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/s3test.py b/tools/s3test.py index 690b6b6..66b1bd9 100755 --- a/tools/s3test.py +++ b/tools/s3test.py @@ -32,8 +32,9 @@ def test_writeread(self): class TestS3PyArrow(unittest.TestCase): @classmethod def setUpClass(cls): - # why is this so slow? - cls.s3 = fs.S3FileSystem(region="", endpoint_override="127.0.0.1:3000", scheme="http", anonymous=True) + # this prevents stupid requests to 169.254.169.254 which take a while + os.environ["AWS_EC2_METADATA_DISABLED"] = "true" + cls.s3 = fs.S3FileSystem(endpoint_override="127.0.0.1:3000", scheme="http", anonymous=True) def get_fresh_key(self): return "bucket/swag-" + binascii.hexlify(os.urandom(10)).decode('utf-8') @@ -74,7 +75,7 @@ def test_deletefile(self): # this needs multipart uploads to work def test_largerw(self): - tbl = pa.table([pa.array(range(5000000)), pa.array(range(5000000))], ['a', 'b']) + tbl = pa.table([pa.array(range(2000000)), pa.array(range(2000000))], ['a', 'b']) key = self.get_fresh_key() pq.write_table(tbl, key, filesystem=self.s3)