mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
test robustness
This commit is contained in:
parent
f35d46318b
commit
6b3335aea5
@ -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 )
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -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 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user