jstests/concurrency/fsm_workload_helpers/check_transaction_server_status_invariants.js
/**
 * Checks that the invariant described by 'predFn' holds for the given samples, with a
 * maximum error of maxErrPct.
 */
Checks that the invariant described by 'predFn' holds for the given samples, with a
maximum error of maxErrPct.
Checks that the invariant described by ' predFn ' holds for the given samples with a maximum error of maxErrPct .
function checkInvariant(samples, predFn, maxErrPct) {
    let failedSamples = filterFalse(samples, predFn);
    let errRate = failedSamples.length / samples.length;
    assertAlways.lte(errRate, maxErrPct, () => {
        let failedSamplesStr = failedSamples.map(tojsononeline).join("\n");
        return "'" + predFn.name + "' invariant violated. Failed samples: " + failedSamplesStr;
    });
}
function checkInvariant ( samples , predFn , maxErrPct ) { let failedSamples = filterFalse ( samples , predFn ) ; let errRate = failedSamples . length / samples . length ; assertAlways . lte ( errRate , maxErrPct , ( ) => { let failedSamplesStr = failedSamples . map ( tojsononeline ) . join ( "\n" ) ; return "'" + predFn . name + "' invariant violated. Failed samples: " + failedSamplesStr ; } ) ; }
Checks that the invariant described by 'predFn' holds for the given samples, with a
 maximum error of maxErrPct.
Checks that the invariant described by ' predFn ' holds for the given samples with a maximum error of maxErrPct .