Skip to content

Commit

Permalink
try extending the timeout to 15 sec?
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbrew committed Sep 27, 2023
1 parent 4e39169 commit f0a555b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions tests/test_result_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Request(object):

class S3StorageTestCase(S3MockedAsyncTestCase):

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_get_image(self):
config = Config(TC_AWS_RESULT_STORAGE_BUCKET=s3_bucket)
ctx = Context(config=config, server=get_server('ACME-SEC'))
Expand All @@ -37,7 +37,7 @@ async def test_can_get_image(self):

self.assertEqual(topic.buffer, IMAGE_BYTES)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_get_randomized_image(self):
config = Config(TC_AWS_RESULT_STORAGE_BUCKET=s3_bucket, TC_AWS_RANDOMIZE_KEYS=True)
ctx = Context(config=config, server=get_server('ACME-SEC'))
Expand All @@ -51,7 +51,7 @@ async def test_can_get_randomized_image(self):

self.assertEqual(topic.buffer, IMAGE_BYTES)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_get_image_with_metadata(self):
config = Config(TC_AWS_RESULT_STORAGE_BUCKET=s3_bucket, TC_AWS_STORE_METADATA=True)
ctx = Context(config=config, server=get_server('ACME-SEC'))
Expand Down
10 changes: 5 additions & 5 deletions tests/test_s3_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class S3LoaderTestCase(S3MockedAsyncTestCase):

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_load_image(self):
client = botocore.session.get_session().create_client('s3', endpoint_url='http://localhost:5000')

Expand All @@ -39,7 +39,7 @@ async def test_can_load_image(self):
self.assertTrue('size' in loader_result.metadata)
self.assertIsNone(loader_result.error)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_returns_404_on_no_image(self):
conf = Config(
TC_AWS_LOADER_BUCKET=s3_bucket,
Expand All @@ -51,7 +51,7 @@ async def test_returns_404_on_no_image(self):
self.assertIsNone(loader_result.buffer)
self.assertEqual(loader_result.error, LoaderResult.ERROR_NOT_FOUND)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_validate_buckets(self):
conf = Config(
TC_AWS_ALLOWED_BUCKETS=['whitelist_bucket'],
Expand All @@ -62,14 +62,14 @@ async def test_can_validate_buckets(self):
self.assertIsNone(image.buffer)

@patch('thumbor.loaders.http_loader.load')
@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_should_use_http_loader(self, load_sync_patch):
conf = Config(TC_AWS_ENABLE_HTTP_LOADER=True)
await s3_loader.load(Context(config=conf), 'http://foo.bar')
self.assertTrue(load_sync_patch.called)

@patch('thumbor.loaders.http_loader.load')
@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_should_not_use_http_loader_if_not_prefixed_with_scheme(self, load_sync_patch):
conf = Config(TC_AWS_ENABLE_HTTP_LOADER=True)
await s3_loader.load(Context(config=conf), 'foo/bar')
Expand Down
22 changes: 11 additions & 11 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class S3StorageTestCase(S3MockedAsyncTestCase):

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_store_image(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -32,7 +32,7 @@ async def test_can_store_image(self):

self.assertEqual(topic, IMAGE_BYTES)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_get_image_existance(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -42,7 +42,7 @@ async def test_can_get_image_existance(self):

self.assertTrue(topic)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_get_image_inexistance(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -51,7 +51,7 @@ async def test_can_get_image_inexistance(self):

self.assertFalse(topic)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_remove_instance(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket,TC_AWS_STORAGE_ROOT_PATH='nana')
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -61,7 +61,7 @@ async def test_can_remove_instance(self):

self.assertFalse(topic)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_remove_then_put_image(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand Down Expand Up @@ -94,7 +94,7 @@ def should_normalize_slash(self):

class CryptoS3StorageTestCase(S3MockedAsyncTestCase):

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_should_raise_on_invalid_config(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
storage = Storage(Context(config=config, server=get_server('')))
Expand All @@ -104,14 +104,14 @@ async def test_should_raise_on_invalid_config(self):
with raises(RuntimeError, match='STORES_CRYPTO_KEY_FOR_EACH_IMAGE can\'t be True if no SECURITY_KEY specified'):
await storage.put_crypto(IMAGE_URL % '9999')

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_getting_crypto_for_a_new_image_returns_none(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
topic = await storage.get_crypto(IMAGE_URL % '9999')
self.assertIsNone(topic)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_does_not_store_if_config_says_not_to(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=False)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -120,7 +120,7 @@ async def test_does_not_store_if_config_says_not_to(self):
topic = await storage.get_crypto(IMAGE_URL % '9998')
self.assertIsNone(topic)

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_store_crypto(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -135,7 +135,7 @@ async def test_can_store_crypto(self):

class DetectorS3StorageTestCase(S3MockedAsyncTestCase):

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_can_store_detector_data(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand All @@ -145,7 +145,7 @@ async def test_can_store_detector_data(self):

self.assertEqual(topic, 'some-data')

@gen_test(timeout=10)
@gen_test(timeout=15)
async def test_returns_none_if_no_detector_data(self):
config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
Expand Down

0 comments on commit f0a555b

Please sign in to comment.