jstests/sharding/libs/resharding_test_fixture.js
/**
     * Calls and returns the value from the supplied function.
     *
     * If a network error is thrown during its execution, then this function will invoke the
     * supplied function a second time. This pattern is useful for tolerating network errors which
     * result from elections triggered by any of the stepUpNewPrimaryOnShard(),
     * killAndRestartPrimaryOnShard(), and shutdownAndRestartPrimaryOnShard() methods.
     *
     * @param fn - the function to be called.
     * @returns the return value from fn.
     */
Calls and returns the value from the supplied function.
If a network error is thrown during its execution, then this function will invoke the
supplied function a second time. This pattern is useful for tolerating network errors which
result from elections triggered by any of the stepUpNewPrimaryOnShard(),
killAndRestartPrimaryOnShard(), and shutdownAndRestartPrimaryOnShard() methods.

@param fn - the function to be called.
@returns the return value from fn.
Calls and returns the value from the supplied function . If a network error is thrown during its execution then this function will invoke the supplied function a second time . This pattern is useful for tolerating network errors which result from elections triggered by any of the stepUpNewPrimaryOnShard () killAndRestartPrimaryOnShard () and shutdownAndRestartPrimaryOnShard () methods . @param fn - the function to be called . @returns the return value from fn .
retryOnceOnNetworkError(fn) {
        try {
            return fn();
        } catch (e) {
            if (!isNetworkError(e)) {
                throw e;
            }
            return fn();
        }
    }
retryOnceOnNetworkError ( fn ) { try { return fn ( ) ; } catch ( e ) { if ( ! isNetworkError ( e ) ) { throw e ; } return fn ( ) ; } }
Calls and returns the value from the supplied function.
Calls and returns the value from the supplied function .