diff options
author | Aaron <aaron@10gen.com> | 2011-03-18 01:58:22 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2011-03-18 01:58:55 -0700 |
commit | 451f248452286fc28700122c22941702f964e8fa (patch) | |
tree | 9f44965f1965f7066cbbab40af6684baa2fc0a05 /jstests/dur | |
parent | 4cea18515c926dc8e496e96793ff8c6d2e312d84 (diff) | |
download | mongo-451f248452286fc28700122c22941702f964e8fa.tar.gz |
SERVER-2791 tests
Diffstat (limited to 'jstests/dur')
-rw-r--r-- | jstests/dur/indexbg.js | 7 | ||||
-rw-r--r-- | jstests/dur/indexbg2.js | 19 |
2 files changed, 26 insertions, 0 deletions
diff --git a/jstests/dur/indexbg.js b/jstests/dur/indexbg.js new file mode 100644 index 00000000000..e78ae4a7202 --- /dev/null +++ b/jstests/dur/indexbg.js @@ -0,0 +1,7 @@ +path = '/data/db/indexbg_dur'; + +m = startMongodEmpty( '--port', 30001, '--dbpath', path, '--journal', '--smallfiles', '--journalOptions', 24 ); +t = m.getDB( 'test' ).test; +t.save( {x:1} ); +t.createIndex( {x:1}, {background:true} ); +t.count(); diff --git a/jstests/dur/indexbg2.js b/jstests/dur/indexbg2.js new file mode 100644 index 00000000000..6a0af247b44 --- /dev/null +++ b/jstests/dur/indexbg2.js @@ -0,0 +1,19 @@ +path = '/data/db/indexbg2_dur'; + +m = startMongodEmpty( '--port', 30001, '--dbpath', path, '--journal', '--smallfiles' ); + +t = m.getDB( 'test' ).test; +t.createIndex( {a:1} ); +t.createIndex( {b:1} ); +t.createIndex( {x:1}, {background:true} ); +for( var i = 0; i < 1000; ++i ) { + t.insert( {_id:i,a:'abcd',b:'bcde',x:'four score and seven years ago'} ); + t.remove( {_id:i} ); +} +sleep( 1000 ); +for( var i = 1000; i < 2000; ++i ) { + t.insert( {_id:i,a:'abcd',b:'bcde',x:'four score and seven years ago'} ); + t.remove( {_id:i} ); +} +t.insert( {_id:2000,a:'abcd',b:'bcde',x:'four score and seven years ago'} ); +assert( !t.getDB().getLastError() ); |