0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-28 07:59:02 +01:00
mongodb/jstests/noPassthrough/architecture/failcommand_failpoint_maxtimems.js
Vishnu K 43ef443301 SERVER-93417 split noPassthrough into sub-directories (#26097)
GitOrigin-RevId: 6e8157f468884ab056ac34ce0e4d45abe5d9c949
2024-09-13 17:08:56 +00:00

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);