summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2015-11-23 12:16:52 -0500
committerJason Rassi <rassi@10gen.com>2015-11-24 14:22:02 -0500
commit777497d4b647fda2732ee45ecf6c170585ea2ca2 (patch)
tree30aa9c8faddc4c3eee09e2a0132788c8ac5ac4c3
parent9e0f3d63b1f7a23080f0465e2c59a821e1b78971 (diff)
downloadmongo-777497d4b647fda2732ee45ecf6c170585ea2ca2.tar.gz
SERVER-21387 bench_test_crud_commands.js: ensure collection exists
Fixes an issue where no write operations would be reported as successful in the following scenario: - The first write triggers a database creation. - The time to pre-allocate data files exceeds the amount of time that the bench worker is running.
-rw-r--r--jstests/core/bench_test_crud_commands.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/jstests/core/bench_test_crud_commands.js b/jstests/core/bench_test_crud_commands.js
index 6b6cafc00cc..7f2ae819086 100644
--- a/jstests/core/bench_test_crud_commands.js
+++ b/jstests/core/bench_test_crud_commands.js
@@ -3,6 +3,8 @@
"use strict";
var coll = db.bench_test_crud_commands;
+ coll.drop();
+ assert.commandWorked(coll.getDB().createCollection(coll.getName()));
function executeBenchRun(benchOps) {
var benchArgs = {ops: benchOps, parallel: 2, seconds: 1, host: db.getMongo().host};