diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-11-25 17:28:02 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-12-03 09:36:10 -0500 |
commit | f423ad99311088658c7aabb1d94ee29137896b90 (patch) | |
tree | 2ae31e374055ecacd4d908ed404e2647710f8e4a /jstests | |
parent | 6c93bae163d0cbd4acf8e127c902844353b72c6b (diff) | |
download | mongo-f423ad99311088658c7aabb1d94ee29137896b90.tar.gz |
SERVER-15826 convertToCapped doesn't need to take a global lock
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/convert_to_capped_nonexistant.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/core/convert_to_capped_nonexistant.js b/jstests/core/convert_to_capped_nonexistant.js index 6a9a8b8ce3d..dcda30d7f8b 100644 --- a/jstests/core/convert_to_capped_nonexistant.js +++ b/jstests/core/convert_to_capped_nonexistant.js @@ -3,6 +3,16 @@ var testDb = db.getSiblingDB("convert_to_capped_nonexistent"); testDb.dropDatabase(); + +// Database does not exist here +var result = testDb.runCommand({convertToCapped: 'foo', size: 1024}); +assert.eq(result.ok, 0, "converting a nonexistent to capped worked and should not have"); +assert.eq(result.errmsg, "source database convert_to_capped_nonexistent does not exist", + "converting a nonexistent to capped failed but for the wrong reason"); + +// Database exists, but collection doesn't +testDb.coll.insert({}); + var result = testDb.runCommand({convertToCapped: 'foo', size: 1024}); assert.eq(result.ok, 0, "converting a nonexistent to capped worked and should not have"); assert.eq(result.errmsg, "source collection convert_to_capped_nonexistent.foo does not exist", |