From 451f248452286fc28700122c22941702f964e8fa Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 18 Mar 2011 01:58:22 -0700 Subject: SERVER-2791 tests --- jstests/dur/indexbg.js | 7 +++++++ jstests/dur/indexbg2.js | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 jstests/dur/indexbg.js create mode 100644 jstests/dur/indexbg2.js (limited to 'jstests/dur') 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() ); -- cgit v1.2.1