jstests/concurrency/fsm_workload_helpers/check_transaction_server_status_invariants.js
/**
 * serverStatus invariant: currentActive + currentInactive = currentOpen
 */
serverStatus invariant: currentActive + currentInactive = currentOpen
serverStatus invariant : currentActive + currentInactive = currentOpen
function activePlusInactiveEqualsOpen(serverStatusTxnStats) {
    let active = Number(serverStatusTxnStats["currentActive"]);
    let inactive = Number(serverStatusTxnStats["currentInactive"]);
    let open = Number(serverStatusTxnStats["currentOpen"]);
    return (active + inactive) === open;
}
function activePlusInactiveEqualsOpen ( serverStatusTxnStats ) { let active = Number ( serverStatusTxnStats [ "currentActive" ] ) ; let inactive = Number ( serverStatusTxnStats [ "currentInactive" ] ) ; let open = Number ( serverStatusTxnStats [ "currentOpen" ] ) ; return ( active + inactive ) === open ; }
serverStatus invariant: currentActive + currentInactive = currentOpen
serverStatus invariant : currentActive + currentInactive = currentOpen
// Stats are returned in NumberLong type. Convert to Number type so we are sure comparison // works as expected.