jstests/free_mon/libs/free_mon.js
/**
     *  Start the Mock HTTP Server.
     */
Start the Mock HTTP Server.
Start the Mock HTTP Server .
start() {
        this.port = allocatePort();
        print("Mock Web server is listening on port: " + this.port);
        let args = [this.python, "-u", this.web_server_py, "--port=" + this.port];
        if (this.fault_type) {
            args.push("--fault=" + this.fault_type);
            if (this.disableFaultsOnStartup) {
                args.push("--disable-faults");
            }
        }
        clearRawMongoProgramOutput();
        this.pid = _startMongoProgram({args: args});
        assert(checkProgram(this.pid));
        assert.soon(function() {
            return rawMongoProgramOutput().search("Mock Web Server Listening") !== -1;
        });
        print("Mock HTTP Server sucessfully started.");
    }
start ( ) { this . port = allocatePort ( ) ; print ( "Mock Web server is listening on port: " + this . port ) ; let args = [ this . python , "-u" , this . web_server_py , "--port=" + this . port ] ; if ( this . fault_type ) { args . push ( "--fault=" + this . fault_type ) ; if ( this . disableFaultsOnStartup ) { args . push ( "--disable-faults" ) ; } } clearRawMongoProgramOutput ( ) ; this . pid = _startMongoProgram ( { args : args } ) ; assert ( checkProgram ( this . pid ) ) ; assert . soon ( function ( ) { return rawMongoProgramOutput ( ) . search ( "Mock Web Server Listening" ) !== - 1 ; } ) ; print ( "Mock HTTP Server sucessfully started." ) ; }
Start the Mock HTTP Server.
Start the Mock HTTP Server .
// Wait for the web server to start