diff options
author | Jonathan Abrahams <jonathan@mongodb.com> | 2018-04-04 19:50:39 -0400 |
---|---|---|
committer | Jonathan Abrahams <jonathan@mongodb.com> | 2018-04-04 19:50:39 -0400 |
commit | 9797d7963f9898ed7db34d04b722005229b8b35b (patch) | |
tree | 9a50900c0571368739d156352c3f6ed092c13ef4 /pytests | |
parent | 64eff878ebe7cce677c6bc35b2156f576336e97d (diff) | |
download | mongo-9797d7963f9898ed7db34d04b722005229b8b35b.tar.gz |
SERVER-34318 Set timeout for canary insert to 1 hour in powertest.py, fix bad merge
Diffstat (limited to 'pytests')
-rwxr-xr-x | pytests/powertest.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/pytests/powertest.py b/pytests/powertest.py index e724a973d0f..c13044674ec 100755 --- a/pytests/powertest.py +++ b/pytests/powertest.py @@ -2224,6 +2224,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) @@ -2377,16 +2380,10 @@ 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, - server_selection_timeout_ms=one_hour_ms, - socket_timeout_ms=one_hour_ms)) - ret = mongo_validate_canary( - mongo, options.db_name, options.collection_name, canary_doc) + mongo = pymongo.MongoClient(**get_mongo_client_args( + host=mongod_host, port=secret_port, server_selection_timeout_ms=one_hour_ms, + socket_timeout_ms=one_hour_ms)) + ret = mongo_validate_canary(mongo, options.db_name, options.collection_name, canary_doc) LOGGER.info("Local canary validation: %d", ret) if ret: sys.exit(ret) @@ -2497,8 +2494,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, server_selection_timeout_ms=one_hour_ms, + socket_timeout_ms=one_hour_ms)) crash_canary["function"] = mongo_insert_canary crash_canary["args"] = [ mongo, |