summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/configExpand_rest_timeout.js
blob: 532ce4e628399d6eee93e0734e499c60c7767dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Test config file expansion using REST at top level.
// @tags: [requires_http_client]

(function() {
    'use strict';

    load('jstests/noPassthrough/libs/configExpand/lib.js');

    const web = new ConfigExpandRestServer();
    web.start();

    // Sleep 10 seconds during request.
    configExpandSuccess({
        setParameter: {
            scramIterationCount: {__rest: web.getStringReflectionURL('12345', {sleep: 10})},
        }
    });

    // Sleep 40 seconds during request, with default 30 second timeout.
    configExpandFailure({
        setParameter: {
            scramIterationCount: {__rest: web.getStringReflectionURL('12345', {sleep: 40})},
        }
    },
                        /Timeout was reached/);

    // Sleep 10 seconds during request, with custom 5 second timeout.
    configExpandFailure({
        setParameter: {
            scramIterationCount: {__rest: web.getStringReflectionURL('12345', {sleep: 10})},
        }
    },
                        /Timeout was reached/,
                        {configExpandTimeoutSecs: 5});

    web.stop();
})();