summaryrefslogtreecommitdiff
path: root/jstests/parallel/manyclients.js
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-01-31 08:32:52 +0100
committerAntonin Kral <a.kral@bobek.cz>2010-01-31 08:32:52 +0100
commit4eefaf421bfeddf040d96a3dafb12e09673423d7 (patch)
treecb2e5ccc7f98158894f977ff131949da36673591 /jstests/parallel/manyclients.js
downloadmongodb-4eefaf421bfeddf040d96a3dafb12e09673423d7.tar.gz
Imported Upstream version 1.3.1
Diffstat (limited to 'jstests/parallel/manyclients.js')
-rw-r--r--jstests/parallel/manyclients.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/jstests/parallel/manyclients.js b/jstests/parallel/manyclients.js
new file mode 100644
index 0000000..14cdec5
--- /dev/null
+++ b/jstests/parallel/manyclients.js
@@ -0,0 +1,26 @@
+// perform inserts in parallel from a large number of clients
+
+f = db.jstests_parallel_manyclients;
+f.drop();
+f.ensureIndex( {who:1} );
+
+Random.setRandomSeed();
+
+t = new ParallelTester();
+
+for( id = 0; id < 200; ++id ) {
+ var g = new EventGenerator( id, "jstests_parallel_manyclients", Random.randInt( 20 ) );
+ for( j = 0; j < 1000; ++j ) {
+ if ( j % 50 == 0 ) {
+ g.addCheckCount( j, {who:id}, true );
+ }
+ g.addInsert( { i:j, who:id } );
+ }
+ t.add( EventGenerator.dispatch, g.getEvents() );
+}
+
+print( "done preparing test" );
+
+t.run( "one or more tests failed" );
+
+assert( f.validate().valid );