summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-03-09 09:30:52 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2018-03-09 09:30:52 -0500
commit3dbea83df2a71384097a42f0870037c8e364efff (patch)
treea61cd1451a789e8d4b09164b1bc706b4fa6e067c
parentdd0728ad20e5929b81b47c55e9a77ab72e0462c1 (diff)
downloadmongo-3dbea83df2a71384097a42f0870037c8e364efff.tar.gz
SERVER-33696 Set timeout_secs for powercycle* task to restrict the duration of a single powercycle loop
-rw-r--r--etc/evergreen.yml6
-rwxr-xr-xpytests/powertest.py20
2 files changed, 21 insertions, 5 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index a82eb7f8942..d52af0931ef 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -4114,6 +4114,7 @@ tasks:
- name: powercycle
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
+ timeout_secs: 1800 # 30 minute timeout for no output
depends_on:
- name: compile
commands:
@@ -4133,6 +4134,7 @@ tasks:
- name: powercycle_fcv3.6
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
+ timeout_secs: 1800 # 30 minute timeout for no output
depends_on:
- name: compile
commands:
@@ -4154,6 +4156,7 @@ tasks:
- name: powercycle_replication
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
+ timeout_secs: 1800 # 30 minute timeout for no output
depends_on:
- name: compile
commands:
@@ -4173,6 +4176,7 @@ tasks:
- name: powercycle_replication_smalloplog
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
+ timeout_secs: 1800 # 30 minute timeout for no output
depends_on:
- name: compile
commands:
@@ -4192,6 +4196,7 @@ tasks:
- name: powercycle_syncdelay
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
+ timeout_secs: 1800 # 30 minute timeout for no output
depends_on:
- name: compile
commands:
@@ -4211,6 +4216,7 @@ tasks:
- name: powercycle_write_concern_majority
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
+ timeout_secs: 1800 # 30 minute timeout for no output
depends_on:
- name: compile
commands:
diff --git a/pytests/powertest.py b/pytests/powertest.py
index 2e943f4bd12..5de67a2f588 100755
--- a/pytests/powertest.py
+++ b/pytests/powertest.py
@@ -1384,12 +1384,16 @@ def wait_for_mongod_shutdown(data_dir, timeout=120):
return 0
-def get_mongo_client_args(host=None, port=None, options=None):
+def get_mongo_client_args(host=None,
+ port=None,
+ options=None,
+ serverSelectionTimeoutMS=600000,
+ socketTimeoutMS=600000):
""" Returns keyword arg dict used in PyMongo client. """
- # Set the serverSelectionTimeoutMS & socketTimeoutMS to 10 minutes
+ # Set the default serverSelectionTimeoutMS & socketTimeoutMS to 10 minutes.
mongo_args = {
- "serverSelectionTimeoutMS": 600000,
- "socketTimeoutMS": 600000
+ "serverSelectionTimeoutMS": serverSelectionTimeoutMS,
+ "socketTimeoutMS": socketTimeoutMS
}
if host:
mongo_args["host"] = host
@@ -2373,8 +2377,14 @@ Examples:
# Optionally validate canary document locally.
if validate_canary_local:
+ # Increase the Pymongo connection timeout to 1 hour.
+ one_hour_ms = 60 * 60 * 1000
mongo = pymongo.MongoClient(
- **get_mongo_client_args(host=mongod_host, port=secret_port))
+ **get_mongo_client_args(
+ host=mongod_host,
+ port=secret_port,
+ serverSelectionTimeoutMS=one_hour_ms,
+ socketTimeoutMS=one_hour_ms))
ret = mongo_validate_canary(
mongo, options.db_name, options.collection_name, canary_doc)
LOGGER.info("Local canary validation: %d", ret)