jstests/noPassthrough/server_transaction_metrics_for_prepared_transactions.js
/**
 * Verifies that the timestamp of the oldest active transaction in the transactions table
 * is greater than the lower bound and less than or equal to the upper bound.
 */
Verifies that the timestamp of the oldest active transaction in the transactions table
is greater than the lower bound and less than or equal to the upper bound.
Verifies that the timestamp of the oldest active transaction in the transactions table is greater than the lower bound and less than or equal to the upper bound .
function verifyOldestActiveTransactionTimestamp(testDB, lowerBound, upperBound) {
    let res = assert.commandWorked(
        testDB.getSiblingDB("config").getCollection("transactions").runCommand("find", {
            "filter": {"state": {"$in": ["prepared", "inProgress"]}},
            "sort": {"startOpTime": 1},
            "readConcern": {"level": "local"},
            "limit": 1
        }));
    let entry = res.cursor.firstBatch[0];
    assert.neq(undefined, entry);
    assert.lt(lowerBound,
              entry.startOpTime.ts,
              "oldest active transaction timestamp should be greater than the lower bound");
    assert.lte(
        entry.startOpTime.ts,
        upperBound,
        "oldest active transaction timestamp should be less than or equal to the upper bound");
}
function verifyOldestActiveTransactionTimestamp ( testDB , lowerBound , upperBound ) { let res = assert . commandWorked ( testDB . getSiblingDB ( "config" ) . getCollection ( "transactions" ) . runCommand ( "find" , { "filter" : { "state" : { "$in" : [ "prepared" , "inProgress" ] } } , "sort" : { "startOpTime" : 1 } , "readConcern" : { "level" : "local" } , "limit" : 1 } ) ) ; let entry = res . cursor . firstBatch [ 0 ] ; assert . neq ( undefined , entry ) ; assert . lt ( lowerBound , entry . startOpTime . ts , "oldest active transaction timestamp should be greater than the lower bound" ) ; assert . lte ( entry . startOpTime . ts , upperBound , "oldest active transaction timestamp should be less than or equal to the upper bound" ) ; }
Verifies that the timestamp of the oldest active transaction in the transactions table
 is greater than the lower bound and less than or equal to the upper bound.
Verifies that the timestamp of the oldest active transaction in the transactions table is greater than the lower bound and less than or equal to the upper bound .