summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-04-10 10:16:43 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-09-06 12:05:08 -0400
commit828a110f9697c7a9eb1e8db96984b7956671a703 (patch)
tree0d6c1de165b14b0927fa9f718db53789e0863e30
parent820cd16eec2165df30b6529bf6b86007edbfdc81 (diff)
downloadmongo-828a110f9697c7a9eb1e8db96984b7956671a703.tar.gz
SERVER-34144 Powercycle output improvements:
- Correct replset name to 'powercycle' - Improve canary insert and validate output (cherry picked from commit 279ef03069aada749b48dbdff527e4020364c0a1)
-rw-r--r--etc/evergreen.yml4
-rwxr-xr-xpytests/powertest.py12
2 files changed, 9 insertions, 7 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index cc5a168ce8a..25132cf900e 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -4860,7 +4860,7 @@ tasks:
timeout_secs: 1800 # 30 minute timeout for no output
vars:
<<: *powercycle_test
- mongod_extra_options: --replSet=powercyle --mongodOptions=\"--setParameter enableTestCommands=1 --storageEngine wiredTiger\"
+ mongod_extra_options: --replSet=powercycle --mongodOptions=\"--setParameter enableTestCommands=1 --storageEngine wiredTiger\"
- name: powercycle_replication_smalloplog_WT
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
@@ -4880,7 +4880,7 @@ tasks:
timeout_secs: 1800 # 30 minute timeout for no output
vars:
<<: *powercycle_test
- mongod_extra_options: --replSet=powercyle --mongodOptions=\"--setParameter enableTestCommands=1 --oplogSize 20 --storageEngine wiredTiger\"
+ mongod_extra_options: --replSet=powercycle --mongodOptions=\"--setParameter enableTestCommands=1 --oplogSize 20 --storageEngine wiredTiger\"
- name: powercycle_syncdelay_WT
exec_timeout_secs: 7200 # 2 hour timeout for the task overall
diff --git a/pytests/powertest.py b/pytests/powertest.py
index 9f05292eecc..0acbedab423 100755
--- a/pytests/powertest.py
+++ b/pytests/powertest.py
@@ -1638,14 +1638,16 @@ def mongo_validate_collections(mongo):
def mongo_validate_canary(mongo, db_name, coll_name, doc):
- """ Validates a canary document. Returns 0 if the document exists. """
- LOGGER.info("Validating canary document %s", doc)
- return 0 if not doc or mongo[db_name][coll_name].find_one(doc) else 1
+ """Validate a canary document, return 0 if the document exists."""
+ if not doc:
+ return 0
+ LOGGER.info("Validating canary document using %s.%s.find_one(%s)", db_name, coll_name, doc)
+ return 0 if mongo[db_name][coll_name].find_one(doc) else 1
def mongo_insert_canary(mongo, db_name, coll_name, doc):
- """ Inserts a canary document with 'j' True. Returns 0 if successful. """
- LOGGER.info("Inserting canary document %s to DB %s Collection %s", doc, db_name, coll_name)
+ """Insert a canary document with 'j' True, return 0 if successful."""
+ LOGGER.info("Inserting canary document using %s.%s.insert_one(%s)", db_name, coll_name, doc)
coll = mongo[db_name][coll_name].with_options(
write_concern=pymongo.write_concern.WriteConcern(j=True))
res = coll.insert_one(doc)