jstests/auth/user-cache-invalidation.js
/**
 * Check the global log for an entry defined by `cond`
 * occuring after the JS Date `after`.
 *
 * Returns the log line matched with the `t` field
 * transposed to a Javascript Date object.
 */
Check the global log for an entry defined by `cond`
occuring after the JS Date `after`.

Returns the log line matched with the `t` field
transposed to a Javascript Date object.
Check the global log for an entry defined by ` cond ` occuring after the JS Date ` after ` . Returns the log line matched with the ` t ` field transposed to a Javascript Date object .
function assertHasLog(conn, cond, after) {
    var ret = undefined;
    assert.soon(function() {
        const log = checkLog.getGlobalLog(conn);
        var line;
        for (line in log) {
            line = JSON.parse(log[line]);
            if (!cond(line)) {
                continue;
            }
            line.t = Date.parse(line.t['$date']);
            if (line.t >= after) {
                ret = line;
                break;
            }
        }
        return ret !== undefined;
    });
    jsTest.log(`Found log entry: ${tojson(ret)}`);
    return ret;
}
function assertHasLog ( conn , cond , after ) { var ret = undefined ; assert . soon ( function ( ) { const log = checkLog . getGlobalLog ( conn ) ; var line ; for ( line in log ) { line = JSON . parse ( log [ line ] ) ; if ( ! cond ( line ) ) { continue ; } line . t = Date . parse ( line . t [ '$date' ] ) ; if ( line . t >= after ) { ret = line ; break ; } } return ret !== undefined ; } ) ; jsTest . log ( ` ${ tojson ( ret ) } ` ) ; return ret ; }
Check the global log for an entry defined by `cond`
 occuring after the JS Date `after`.
Check the global log for an entry defined by ` cond ` occuring after the JS Date ` after ` .