mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
start of SyncClusterConnection tests
This commit is contained in:
parent
63b5f7e470
commit
c85b784793
11
jstests/sharding/sync1.js
Normal file
11
jstests/sharding/sync1.js
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
test = new SyncCCTest( "sync1" )
|
||||
|
||||
t = test.conn.getDB( "test" ).sync1
|
||||
t.save( { x : 1 } )
|
||||
assert.eq( 1 , t.find().itcount() , "A1" );
|
||||
t.save( { x : 2 } )
|
||||
assert.eq( 1 , t.find().itcount() , "A2" );
|
||||
|
||||
|
||||
test.stop();
|
@ -633,7 +633,18 @@ allocatePorts = function( n ) {
|
||||
|
||||
|
||||
SyncCCTest = function( testName ){
|
||||
|
||||
this._connections = [];
|
||||
|
||||
for ( var i=0; i<3; i++ ){
|
||||
this._connections.push( startMongodTest( 30000 + i , testName + i ) );
|
||||
}
|
||||
|
||||
this.url = this._connections.map( function(z){ return z.name; } ).join( "," );
|
||||
print( this.url );
|
||||
}
|
||||
|
||||
SyncCCTest.prototype.stop = function(){
|
||||
for ( var i=0; i<this._connections.length; i++){
|
||||
stopMongod( 30000 + i );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user