jstests/core/txns/transactions_block_ddl.js
/**
 * Tests that DDL operations block on transactions and fail when their maxTimeMS expires.
 */
Tests that DDL operations block on transactions and fail when their maxTimeMS expires.
Tests that DDL operations block on transactions and fail when their maxTimeMS expires .
function testTimeout(cmdDBName, ddlCmd) {
    runSetup();
    session.startTransaction();
    assert.commandWorked(sessionColl.insert({a: 5, b: 6}));
    assert.commandFailedWithCode(
        testDB.getSiblingDB(cmdDBName).runCommand(Object.assign({}, ddlCmd, {maxTimeMS: 500})),
        ErrorCodes.MaxTimeMSExpired);
    assert.commandWorked(session.commitTransaction_forTesting());
}
function testTimeout ( cmdDBName , ddlCmd ) { runSetup ( ) ; session . startTransaction ( ) ; assert . commandWorked ( sessionColl . insert ( { a : 5 , b : 6 } ) ) ; assert . commandFailedWithCode ( testDB . getSiblingDB ( cmdDBName ) . runCommand ( Object . assign ( { } , ddlCmd , { maxTimeMS : 500 } ) ) , ErrorCodes . MaxTimeMSExpired ) ; assert . commandWorked ( session . commitTransaction_forTesting ( ) ) ; }
Tests that DDL operations block on transactions and fail when their maxTimeMS expires.
Tests that DDL operations block on transactions and fail when their maxTimeMS expires .
// Setup.