0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

test robustness

This commit is contained in:
Eliot Horowitz 2010-08-03 14:01:12 -04:00
parent f35d46318b
commit 6b3335aea5
2 changed files with 12 additions and 7 deletions

View File

@ -215,10 +215,14 @@ ShardingTest = function( testName , numShards , verboseLevel , numMongos , other
this._connections.forEach(
function(z){
var n = z.name;
if ( ! n )
n = z;
if ( ! n ){
n = z.host;
if ( ! n )
n = z;
}
print( "going to add shard: " + n )
admin.runCommand( { addshard : n } );
x = admin.runCommand( { addshard : n } );
printjson( x )
}
);
}

View File

@ -439,11 +439,12 @@ namespace mongo {
try {
// This assumes there aren't any 0's in the mongo program output.
// Hope that's ok.
char buf[ 4096 ];
char temp[ 4096 ];
const unsigned bufSize = 8192;
char buf[ bufSize ];
char temp[ bufSize ];
char *start = buf;
while( 1 ) {
int lenToRead = 4095 - ( start - buf );
int lenToRead = ( bufSize - 1 ) - ( start - buf );
assert( lenToRead > 0 );
int ret = read( pipe_, (void *)start, lenToRead );
if( mongo::goingAway )
@ -467,7 +468,7 @@ namespace mongo {
strcpy( temp, last );
strcpy( buf, temp );
} else {
assert( strlen( buf ) <= 4095 );
assert( strlen( buf ) < bufSize );
}
start = buf + strlen( buf );
}