mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-28 07:59:02 +01:00
43ef443301
GitOrigin-RevId: 6e8157f468884ab056ac34ce0e4d45abe5d9c949
26 lines
540 B
JavaScript
26 lines
540 B
JavaScript
var conn = MongoRunner.runMongod();
|
|
var admin = conn.getDB('admin');
|
|
var db = conn.getDB('test');
|
|
|
|
var fpCmd = {
|
|
configureFailPoint: 'failCommand',
|
|
mode: {times: 1},
|
|
data: {
|
|
failCommands: ['insert'],
|
|
blockConnection: true,
|
|
blockTimeMS: 1000,
|
|
},
|
|
};
|
|
|
|
assert.commandWorked(admin.runCommand(fpCmd));
|
|
|
|
var insertCmd = {
|
|
insert: 'coll',
|
|
documents: [{x: 1}],
|
|
maxTimeMS: 100,
|
|
};
|
|
|
|
assert.commandFailedWithCode(db.runCommand(insertCmd), ErrorCodes.MaxTimeMSExpired);
|
|
|
|
MongoRunner.stopMongod(conn);
|