From e8e18af01070ffbb42b0dfcdc31cfddc38992044 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:11:29 +0200 Subject: [PATCH 01/15] Try adding back MongoDB change to see if it helps with the tests performance. --- .travis.yml | 14 ++++--- scripts/travis/install-and-run-mongodb.sh | 46 +++++++++++++---------- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d79960b38..e547e30eaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ branches: env: global: - CACHE_NAME=JOB1 + - MONGODB_VERSION=3.4.16 matrix: include: - env: TASK=ci-unit NODE_INDEX=0 NODE_TOTAL=2 @@ -29,13 +30,13 @@ matrix: addons: apt: sources: - - mongodb-upstart - - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse' - key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc' + #- mongodb-upstart + #- sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse' + # key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc' - sourceline: 'ppa:git-core/ppa' packages: - - mongodb-org-server - - mongodb-org-shell + #- mongodb-org-server + #- mongodb-org-shell - git services: @@ -60,6 +61,9 @@ install: - if [ "${TASK}" = 'compilepy3 ci-py3-unit' ] || [ "${TASK}" = 'ci-py3-integration' ]; then pip install "tox==3.0.0"; else make requirements; fi - if [ "${TASK}" = 'ci-unit' ] || [ "${TASK}" = 'ci-integration' ]; then pip install codecov; fi - if [ "${TASK}" = 'ci-unit' ] || [ "${TASK}" = 'ci-integration' ] || [ "${TASK}" = 'compilepy3 ci-py3-unit' ] || [ "${TASK}" = 'ci-py3-integration' ]; then sudo .circle/add-itest-user.sh; fi + # Note: We use ramdisk for better performance + - if [ ${TASK} = 'ci-unit' ] || [ ${TASK} = 'ci-integration' ] || [ ${TASK} = 'ci-py3-integration' ]; then sudo -E ./scripts/travis/create-and-mount-ramdisk.sh; fi + - if [ ${TASK} = 'ci-unit' ] || [ ${TASK} = 'ci-integration' ] || [ ${TASK} = 'ci-py3-integration' ]; then ./scripts/travis/install-and-run-mongodb.sh; fi # Let's enable rabbitmqadmin # See https://github.com/messagebus/lapine/wiki/Testing-on-Travis. diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index 77ab381eb5..8d9fbfb896 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -1,33 +1,41 @@ #!/usr/bin/env bash # Script which installs versions of MongoDB specified using an environment variable - -if [ ! "${MONGODB}" ]; then - echo "MONGODB environment variable not set" +if [ ! "${MONGODB_VERSION}" ]; then + echo "MONGODB_VERSION environment variable not set." exit 2 fi -# Note: MongoDB 2.4 and 2.6 don't work with ramdisk since they don't work with -# small files and require at least 3 GB of space -if [ ${MONGODB} = '2.4.9' ] || [ ${MONGODB} = '2.6.12' ]; then - DATA_DIR=/tmp/mongodbdata -else - DATA_DIR=/mnt/ramdisk/mongodb -fi +DATA_DIR=/tmp/mongodbdata +MONGODB_DIR=/tmp/mongodb -wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB}.tgz -O /tmp/mongodb.tgz -tar -xvf /tmp/mongodb.tgz mkdir -p ${DATA_DIR} -echo "Starting MongoDB v${MONGODB}" -${PWD}/mongodb-linux-x86_64-${MONGODB}/bin/mongod --nojournal --journalCommitInterval 500 \ - --syncdelay 0 --dbpath ${DATA_DIR} --bind_ip 127.0.0.1 &> /tmp/mongodb.log & -EXIT_CODE=$? +mkdir -p ${MONGODB_DIR} + +DOWNLOAD_URL="http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB_VERSION}.tgz" + +echo "Downloading MongoDB ${MONGODB_VERSION} from ${DOWNLOAD_URL}" +wget -q ${DOWNLOAD_URL} -O /tmp/mongodb.tgz +tar -xvf /tmp/mongodb.tgz -C ${MONGODB_DIR} --strip=1 + +echo "Starting MongoDB v${MONGODB_VERSION}" +# Note: We use --notablescan option to detected missing indexes early. When this +# option is enabled, queries which result in table scan (which usually means a +# missing index or a bad query) are not allowed and result in a failed test. +${MONGODB_DIR}/bin/mongod --nojournal --journalCommitInterval 500 --syncdelay 0 \ + --wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting --notablescan \ + --dbpath ${DATA_DIR} --bind_ip 127.0.0.1 &> /tmp/mongodb.log & +MONGODB_PID=$! + +# Give process some time to start up sleep 5 -if [ ${EXIT_CODE} -ne 0 ]; then +if ps -p ${MONGODB_PID} > /dev/null; then + echo "MongoDB successfuly started" + tail -30 /tmp/mongodb.log + exit 9 +else echo "Failed to start MongoDB" tail -30 /tmp/mongodb.log exit 1 fi - -tail -30 /tmp/mongodb.log From 3c383426eb12d2646464973cf8b4c0574b52d543 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:15:05 +0200 Subject: [PATCH 02/15] Comment out the mongodb service. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e547e30eaa..992d19632d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,6 @@ addons: - git services: - - mongodb - rabbitmq cache: From 9e9be560d5cbb6343ca0e5d7f4c2737905dccf02 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:20:55 +0200 Subject: [PATCH 03/15] Use a ram disk, exit with 0 on success. --- scripts/travis/install-and-run-mongodb.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index 8d9fbfb896..fdb8615ebb 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -6,7 +6,14 @@ if [ ! "${MONGODB_VERSION}" ]; then exit 2 fi -DATA_DIR=/tmp/mongodbdata +# Note: MongoDB 2.4 and 2.6 don't work with ramdisk since they don't work with +# small files and require at least 3 GB of space +if [ ${MONGODB} = '2.4.9' ] || [ ${MONGODB} = '2.6.12' ]; then + DATA_DIR=/tmp/mongodbdata +else + DATA_DIR=/mnt/ramdisk/mongodb +fi + MONGODB_DIR=/tmp/mongodb mkdir -p ${DATA_DIR} @@ -33,7 +40,7 @@ sleep 5 if ps -p ${MONGODB_PID} > /dev/null; then echo "MongoDB successfuly started" tail -30 /tmp/mongodb.log - exit 9 + exit 0 else echo "Failed to start MongoDB" tail -30 /tmp/mongodb.log From 2d46526f87ac0602ad66f4b4358b2c0dd79fc822 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:25:58 +0200 Subject: [PATCH 04/15] Still install mongodb-shell package so we use the latest version. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 992d19632d..58ec7ed307 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,12 +31,12 @@ addons: apt: sources: #- mongodb-upstart - #- sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse' - # key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc' + - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse' + key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc' - sourceline: 'ppa:git-core/ppa' packages: #- mongodb-org-server - #- mongodb-org-shell + - mongodb-org-shell - git services: From 7deec3ed8847ecc260e924bdea56d04629d1e08f Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:28:13 +0200 Subject: [PATCH 05/15] Symlink mongo binary from the downloaded tarball instead. --- .travis.yml | 6 +++--- scripts/travis/install-and-run-mongodb.sh | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 58ec7ed307..6da1c3ee7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,12 +31,12 @@ addons: apt: sources: #- mongodb-upstart - - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse' - key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc' + # - sourceline: 'deb [arch=amd64] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.4 multiverse' + # key_url: 'https://www.mongodb.org/static/pgp/server-3.4.asc' - sourceline: 'ppa:git-core/ppa' packages: #- mongodb-org-server - - mongodb-org-shell + #- mongodb-org-shell - git services: diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index fdb8615ebb..8c844efcb5 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -25,6 +25,10 @@ echo "Downloading MongoDB ${MONGODB_VERSION} from ${DOWNLOAD_URL}" wget -q ${DOWNLOAD_URL} -O /tmp/mongodb.tgz tar -xvf /tmp/mongodb.tgz -C ${MONGODB_DIR} --strip=1 +# Symlink latest mongodb shell +sudo ln -sf ${MONGODB_PID}/bin/mongo /usr/local/bin/mongo +sudo ln -sf ${MONGODB_PID}/bin/mongo /usr/bin/mongo + echo "Starting MongoDB v${MONGODB_VERSION}" # Note: We use --notablescan option to detected missing indexes early. When this # option is enabled, queries which result in table scan (which usually means a From 364fc09559aed23045046f4167df557ed5f1480c Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:29:34 +0200 Subject: [PATCH 06/15] Temporary remove --notablescan option so we can just test the performance. --- scripts/travis/install-and-run-mongodb.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index 8c844efcb5..3584e474d4 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -34,7 +34,8 @@ echo "Starting MongoDB v${MONGODB_VERSION}" # option is enabled, queries which result in table scan (which usually means a # missing index or a bad query) are not allowed and result in a failed test. ${MONGODB_DIR}/bin/mongod --nojournal --journalCommitInterval 500 --syncdelay 0 \ - --wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting --notablescan \ + --wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting \ + #--wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting --notablescan \ --dbpath ${DATA_DIR} --bind_ip 127.0.0.1 &> /tmp/mongodb.log & MONGODB_PID=$! From 1c89e4aab35b1ee0e6ebb254a82e9aa32a52cf25 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:35:01 +0200 Subject: [PATCH 07/15] Also run mongo --version step. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6da1c3ee7b..b234b50267 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,6 +67,7 @@ install: # Let's enable rabbitmqadmin # See https://github.com/messagebus/lapine/wiki/Testing-on-Travis. before_script: + - mongo --version - git --version - pip --version - virtualenv --version From 2656bcaf3c5c08f3a6657a785109b34fae9e5da6 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 14:35:36 +0200 Subject: [PATCH 08/15] Fix typo. --- scripts/travis/install-and-run-mongodb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index 3584e474d4..a35558c64f 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -8,7 +8,7 @@ fi # Note: MongoDB 2.4 and 2.6 don't work with ramdisk since they don't work with # small files and require at least 3 GB of space -if [ ${MONGODB} = '2.4.9' ] || [ ${MONGODB} = '2.6.12' ]; then +if [ "${MONGODB_VERSION}" = '2.4.9' ] || [ "${MONGODB_VERSION}" = '2.6.12' ]; then DATA_DIR=/tmp/mongodbdata else DATA_DIR=/mnt/ramdisk/mongodb @@ -33,9 +33,9 @@ echo "Starting MongoDB v${MONGODB_VERSION}" # Note: We use --notablescan option to detected missing indexes early. When this # option is enabled, queries which result in table scan (which usually means a # missing index or a bad query) are not allowed and result in a failed test. +#--wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting --notablescan \ ${MONGODB_DIR}/bin/mongod --nojournal --journalCommitInterval 500 --syncdelay 0 \ --wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting \ - #--wiredTigerStatisticsLogDelaySecs 0 --noIndexBuildRetry --noscripting --notablescan \ --dbpath ${DATA_DIR} --bind_ip 127.0.0.1 &> /tmp/mongodb.log & MONGODB_PID=$! From 4ea45866367642367d57b2e53c3131c2355b8e54 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 15:39:38 +0200 Subject: [PATCH 09/15] Fix typo, add log statement. --- scripts/travis/install-and-run-mongodb.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index a35558c64f..919df3829f 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -25,9 +25,11 @@ echo "Downloading MongoDB ${MONGODB_VERSION} from ${DOWNLOAD_URL}" wget -q ${DOWNLOAD_URL} -O /tmp/mongodb.tgz tar -xvf /tmp/mongodb.tgz -C ${MONGODB_DIR} --strip=1 +echo "Symlinking mongo shell binary to /usr/local/bin" + # Symlink latest mongodb shell -sudo ln -sf ${MONGODB_PID}/bin/mongo /usr/local/bin/mongo -sudo ln -sf ${MONGODB_PID}/bin/mongo /usr/bin/mongo +sudo ln -sf ${MONGODB_DIR}/bin/mongo /usr/local/bin/mongo +sudo ln -sf ${MONGODB_DIR}/bin/mongo /usr/bin/mongo echo "Starting MongoDB v${MONGODB_VERSION}" # Note: We use --notablescan option to detected missing indexes early. When this From e13f51a55cb75dbee54327c42b5c4764936b7ce4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 16:12:23 +0200 Subject: [PATCH 10/15] Try skipping ram disk. --- scripts/travis/install-and-run-mongodb.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/travis/install-and-run-mongodb.sh b/scripts/travis/install-and-run-mongodb.sh index 919df3829f..fbe8abdc6f 100755 --- a/scripts/travis/install-and-run-mongodb.sh +++ b/scripts/travis/install-and-run-mongodb.sh @@ -14,6 +14,7 @@ else DATA_DIR=/mnt/ramdisk/mongodb fi +DATA_DIR=/tmp/mongodbdata MONGODB_DIR=/tmp/mongodb mkdir -p ${DATA_DIR} From a280e49a2961b36ad6abd5f16711de0e605990c3 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 16:39:18 +0200 Subject: [PATCH 11/15] No need to drop collections one by one since we already drop the whole database, don't ensure indexes twice. --- st2tests/st2tests/base.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/st2tests/st2tests/base.py b/st2tests/st2tests/base.py index b65d769136..0e8a2f9183 100644 --- a/st2tests/st2tests/base.py +++ b/st2tests/st2tests/base.py @@ -196,12 +196,17 @@ def _establish_connection_and_re_create_db(cls): cls.db_connection = db_setup( cfg.CONF.database.db_name, cfg.CONF.database.host, cfg.CONF.database.port, username=username, password=password, ensure_indexes=False) - cls._drop_collections() + + # NOTE: In older MongoDB versions you needed to drop all the collections prior to dropping + # the database - that's not needed anymore with the wiredtiger engine + #cls._drop_collections() + cls.db_connection.drop_database(cfg.CONF.database.db_name) # Explicity ensure indexes after we re-create the DB otherwise ensure_indexes could failure # inside db_setup if test inserted invalid data - db_ensure_indexes() + if cls.ensure_indexes: + db_ensure_indexes() @classmethod def _drop_db(cls): @@ -217,7 +222,6 @@ def _drop_collections(cls): # subsequent tests. # See: https://github.com/MongoEngine/mongoengine/issues/566 # See: https://github.com/MongoEngine/mongoengine/issues/565 - global ALL_MODELS for model in ALL_MODELS: model.drop_collection() @@ -234,6 +238,7 @@ class DbTestCase(BaseDbTestCase): current_result = None register_packs = False register_pack_configs = False + ensure_indexes = False @classmethod def setUpClass(cls): From 57822d74c99a3ce7802310847a26cabd67344084 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 16:41:23 +0200 Subject: [PATCH 12/15] Move it to the correct class. --- st2tests/st2tests/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/st2tests/st2tests/base.py b/st2tests/st2tests/base.py index 0e8a2f9183..fe2da5ee55 100644 --- a/st2tests/st2tests/base.py +++ b/st2tests/st2tests/base.py @@ -176,6 +176,7 @@ def tearDownClass(cls): class BaseDbTestCase(BaseTestCase): + ensure_indexes = False # Set to True to enable printing of all the log messages to the console DISPLAY_LOG_MESSAGES = False @@ -238,7 +239,6 @@ class DbTestCase(BaseDbTestCase): current_result = None register_packs = False register_pack_configs = False - ensure_indexes = False @classmethod def setUpClass(cls): From a7a07a9a5a8ba97cfdfb929d3fd871691d1e07a4 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 16:50:32 +0200 Subject: [PATCH 13/15] Create ramdisk and start mongodb for all the tasks. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b234b50267..6a916c880f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,8 +61,8 @@ install: - if [ "${TASK}" = 'ci-unit' ] || [ "${TASK}" = 'ci-integration' ]; then pip install codecov; fi - if [ "${TASK}" = 'ci-unit' ] || [ "${TASK}" = 'ci-integration' ] || [ "${TASK}" = 'compilepy3 ci-py3-unit' ] || [ "${TASK}" = 'ci-py3-integration' ]; then sudo .circle/add-itest-user.sh; fi # Note: We use ramdisk for better performance - - if [ ${TASK} = 'ci-unit' ] || [ ${TASK} = 'ci-integration' ] || [ ${TASK} = 'ci-py3-integration' ]; then sudo -E ./scripts/travis/create-and-mount-ramdisk.sh; fi - - if [ ${TASK} = 'ci-unit' ] || [ ${TASK} = 'ci-integration' ] || [ ${TASK} = 'ci-py3-integration' ]; then ./scripts/travis/install-and-run-mongodb.sh; fi + - sudo -E ./scripts/travis/create-and-mount-ramdisk.sh + - ./scripts/travis/install-and-run-mongodb.sh # Let's enable rabbitmqadmin # See https://github.com/messagebus/lapine/wiki/Testing-on-Travis. From ba69053df7df40ca1cccb2df953c10252d510f69 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 16:51:23 +0200 Subject: [PATCH 14/15] No need to drop collections before dropping the db anymore. --- st2tests/st2tests/base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/st2tests/st2tests/base.py b/st2tests/st2tests/base.py index fe2da5ee55..78e25180ee 100644 --- a/st2tests/st2tests/base.py +++ b/st2tests/st2tests/base.py @@ -176,6 +176,8 @@ def tearDownClass(cls): class BaseDbTestCase(BaseTestCase): + # True to ensure indexes before db_setup is called - NOTE: This is only + # needed with older MongoDB versions ensure_indexes = False # Set to True to enable printing of all the log messages to the console @@ -200,7 +202,7 @@ def _establish_connection_and_re_create_db(cls): # NOTE: In older MongoDB versions you needed to drop all the collections prior to dropping # the database - that's not needed anymore with the wiredtiger engine - #cls._drop_collections() + # cls._drop_collections() cls.db_connection.drop_database(cfg.CONF.database.db_name) @@ -211,9 +213,13 @@ def _establish_connection_and_re_create_db(cls): @classmethod def _drop_db(cls): - cls._drop_collections() + # NOTE: In older MongoDB versions you needed to drop all the collections prior to dropping + # the database - that's not needed anymore with the wiredtiger engine + # cls._drop_collections() + if cls.db_connection is not None: cls.db_connection.drop_database(cfg.CONF.database.db_name) + db_teardown() cls.db_connection = None From 784a25f2b57bf43c2f96f28a7f131ae9ffff40db Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Tue, 24 Jul 2018 16:58:00 +0200 Subject: [PATCH 15/15] Clarify the comment. --- st2tests/st2tests/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/st2tests/st2tests/base.py b/st2tests/st2tests/base.py index 78e25180ee..451f5295f5 100644 --- a/st2tests/st2tests/base.py +++ b/st2tests/st2tests/base.py @@ -176,8 +176,9 @@ def tearDownClass(cls): class BaseDbTestCase(BaseTestCase): - # True to ensure indexes before db_setup is called - NOTE: This is only - # needed with older MongoDB versions + # True to synchronously ensure indexes after db_setup is called - NOTE: This is only needed + # with older MongoDB versions. With recent versions this is not needed for the tests anymore + # and offers significant test speeds ups. ensure_indexes = False # Set to True to enable printing of all the log messages to the console