Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2664)

Unified Diff: appengine/findit/handlers/test/config_test.py

Issue 2526963002: [Findit] Implement retry within swarming_util.py when making server calls (Closed)
Patch Set: Addressing comments Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/handlers/test/config_test.py
diff --git a/appengine/findit/handlers/test/config_test.py b/appengine/findit/handlers/test/config_test.py
index 2926b9305a10742c4825d14f3ffed5952c10bb28..c36cf4a837ca43a7d4fc5ea7d5230be6fda17694 100644
--- a/appengine/findit/handlers/test/config_test.py
+++ b/appengine/findit/handlers/test/config_test.py
@@ -68,7 +68,10 @@ _MOCK_SWARMING_SETTINGS = {
'isolated_storage_url': 'isolateserver.storage.googleapis.com',
'iterations_to_rerun': 10,
'get_swarming_task_id_timeout_seconds': 5 * 60, # 5 minutes.
- 'get_swarming_task_id_wait_seconds': 10
+ 'get_swarming_task_id_wait_seconds': 10,
+ 'server_retry_timeout_hours': 2,
+ 'maximum_server_contact_retry_interval_seconds': 5 * 60, # 5 minutes.
+ 'should_retry_server': False, # No retry for unit testing.
}
@@ -626,6 +629,48 @@ class ConfigTest(testing.AppengineTestCase):
'get_swarming_task_id_timeout_seconds': 300,
'get_swarming_task_id_wait_seconds': [] # Should be an int.
}))
+ self.assertFalse(config._ValidateSwarmingSettings({
+ 'server_host': 'chromium-swarm.appspot.com',
+ 'default_request_priority': 150,
+ 'request_expiration_hours': 20,
+ 'server_query_interval_seconds': 60,
+ 'task_timeout_hours': 23,
+ 'isolated_server': 'https://isolateserver.appspot.com',
+ 'isolated_storage_url': 'isolateserver.storage.googleapis.com',
+ 'iterations_to_rerun': 1,
+ 'get_swarming_task_id_timeout_seconds': 300,
+ 'get_swarming_task_id_wait_secondds': 10,
+ 'server_retry_timeout_hours': {} # Should be an int.
+ }))
+ self.assertFalse(config._ValidateSwarmingSettings({
+ 'server_host': 'chromium-swarm.appspot.com',
+ 'default_request_priority': 150,
+ 'request_expiration_hours': 20,
+ 'server_query_interval_seconds': 60,
+ 'task_timeout_hours': 23,
+ 'isolated_server': 'https://isolateserver.appspot.com',
+ 'isolated_storage_url': 'isolateserver.storage.googleapis.com',
+ 'iterations_to_rerun': 1,
+ 'get_swarming_task_id_timeout_seconds': 300,
+ 'get_swarming_task_id_wait_secondds': 10,
+ 'server_retry_timeout_hours': 1,
+ 'maximum_server_contact_retry_interval_seconds': '' # Should be an int.
+ }))
+ self.assertFalse(config._ValidateSwarmingSettings({
+ 'server_host': 'chromium-swarm.appspot.com',
+ 'default_request_priority': 150,
+ 'request_expiration_hours': 20,
+ 'server_query_interval_seconds': 60,
+ 'task_timeout_hours': 23,
+ 'isolated_server': 'https://isolateserver.appspot.com',
+ 'isolated_storage_url': 'isolateserver.storage.googleapis.com',
+ 'iterations_to_rerun': 1,
+ 'get_swarming_task_id_timeout_seconds': 300,
+ 'get_swarming_task_id_wait_secondds': 10,
+ 'server_retry_timeout_hours': 1,
+ 'maximum_server_contact_retry_interval_seconds': 2,
+ 'should_retry_server': 3 # Should be a bool.
+ }))
self.assertTrue(config._ValidateSwarmingSettings({
'server_host': 'chromium-swarm.appspot.com',
'default_request_priority': 150,
@@ -636,7 +681,10 @@ class ConfigTest(testing.AppengineTestCase):
'isolated_storage_url': 'isolateserver.storage.googleapis.com',
'iterations_to_rerun': 10,
'get_swarming_task_id_timeout_seconds': 300,
- 'get_swarming_task_id_wait_seconds': 10
+ 'get_swarming_task_id_wait_seconds': 10,
+ 'server_retry_timeout_hours': 1,
+ 'maximum_server_contact_retry_interval_seconds': 1,
+ 'should_retry_server': False,
}))
def testValidateDownloadBuildDataSettings(self):

Powered by Google App Engine
This is Rietveld 408576698