summaryrefslogtreecommitdiff
path: root/pytests
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-04-04 16:50:53 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-04-04 16:50:53 -0400
commitb7631b5698effad672d22014156dc16d6f51bf3d (patch)
treea5889e1477a9afadf9e4c12b29921d1512531a71 /pytests
parent40cad604c1401f1ccfe66bcee011d824b2cac27e (diff)
downloadmongo-b7631b5698effad672d22014156dc16d6f51bf3d.tar.gz
SERVER-34318 Set timeout for canary insert to 1 hour in powertest.py
Diffstat (limited to 'pytests')
-rwxr-xr-xpytests/powertest.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pytests/powertest.py b/pytests/powertest.py
index 7c6bbb72e96..2047f176aa8 100755
--- a/pytests/powertest.py
+++ b/pytests/powertest.py
@@ -2047,6 +2047,9 @@ Examples:
orig_canary_doc = canary_doc = ""
validate_canary_cmd = ""
+ # Set the Pymongo connection timeout to 1 hour for canary insert & validation.
+ one_hour_ms = 60 * 60 * 1000
+
# The remote mongod host comes from the ssh_user_host,
# which may be specified as user@host.
ssh_user, ssh_host = get_user_host(options.ssh_user_host)
@@ -2187,8 +2190,6 @@ 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, serverSelectionTimeoutMS=one_hour_ms,
socketTimeoutMS=one_hour_ms))
@@ -2278,8 +2279,9 @@ Examples:
if options.canary:
canary_doc = {"x": time.time()}
orig_canary_doc = copy.deepcopy(canary_doc)
- mongo = pymongo.MongoClient(**get_mongo_client_args(host=mongod_host,
- port=standard_port))
+ mongo = pymongo.MongoClient(**get_mongo_client_args(
+ host=mongod_host, port=standard_port, serverSelectionTimeoutMS=one_hour_ms,
+ socketTimeoutMS=one_hour_ms))
crash_canary["function"] = mongo_insert_canary
crash_canary["args"] = [mongo, options.db_name, options.collection_name, canary_doc]
ret, output = crash_server(options, crash_canary, standard_port, local_ops, script_name,