DataBiosphere / azul

Metadata indexer and query service used for AnVIL, HCA, LungMAP, and CGP
Apache License 2.0
7 stars 2 forks source link

LocalAppTestCase does not use a realistic lambda timeout #4089

Open hannes-ucsc opened 2 years ago

hannes-ucsc commented 2 years ago

Glancing at https://github.com/DataBiosphere/azul-chalice/blob/1c6a7246c35e8c3949d54ee1ef406e864b5764a6/chalice/local.py#L231 it seems that the default timeout of 3s is used. It should be the same timeout that we use for deployed Lambda functions.

hannes-ucsc commented 2 years ago

Spike to verify.

nadove-ucsc commented 2 years ago

LocalAppTestCase overrides the default timeout to match the configured APIGateway timeout (31 seconds):

https://github.com/DataBiosphere/azul/blob/dc8776e7b572285b6e27ebd50d5c9e782cd721e9/test/app_test_case.py#L124

This is overriden to 15 seconds (hardcoded) in RepositoryPluginTestCase and DrsEndpointTest

https://github.com/DataBiosphere/azul/blob/dc8776e7b572285b6e27ebd50d5c9e782cd721e9/test/service/test_drs.py#L61 https://github.com/DataBiosphere/azul/blob/dc8776e7b572285b6e27ebd50d5c9e782cd721e9/test/service/test_repository_proxy.py#L84

I confirmed that the configured timeout is used at runtime in the LambdaContext initializer, after being converted to milliseconds. However self.app_module.app.lambda_context.get_current_time_in_millis gives nonsensical results in the DRS test due to patching time.time.

melainalegaspi commented 2 years ago

@hannes-ucsc : "We can't figure out why 15 seconds is being used. Change that to 31 seconds."