diff options
Diffstat (limited to 'jstests/libs/jstestfuzz/check_for_interrupt_hook.js')
-rw-r--r-- | jstests/libs/jstestfuzz/check_for_interrupt_hook.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/jstests/libs/jstestfuzz/check_for_interrupt_hook.js b/jstests/libs/jstestfuzz/check_for_interrupt_hook.js index 8612824a637..0a2a3add0d0 100644 --- a/jstests/libs/jstestfuzz/check_for_interrupt_hook.js +++ b/jstests/libs/jstestfuzz/check_for_interrupt_hook.js @@ -2,46 +2,46 @@ // the failpoint for the duration of the serverInfo section of the fuzzer's preamble. (function() { - 'use strict'; +'use strict'; - load('jstests/libs/jstestfuzz/hook_utils.js'); +load('jstests/libs/jstestfuzz/hook_utils.js'); - let threadName; +let threadName; - const disableCheckForInterruptFailFP = function() { - // There is no synchronization between fuzzer clients so this hook cannot run with the - // concurrent fuzzer. - assert.eq(TestData.numTestClients, - 1, - 'Cannot run the check for interrupt hook when there is more than 1 client'); +const disableCheckForInterruptFailFP = function() { + // There is no synchronization between fuzzer clients so this hook cannot run with the + // concurrent fuzzer. + assert.eq(TestData.numTestClients, + 1, + 'Cannot run the check for interrupt hook when there is more than 1 client'); - const myUriRes = assert.commandWorked(db.runCommand({whatsmyuri: 1})); - const myUri = myUriRes.you; + const myUriRes = assert.commandWorked(db.runCommand({whatsmyuri: 1})); + const myUri = myUriRes.you; - const curOpRes = assert.commandWorked(db.adminCommand({currentOp: 1, client: myUri})); - threadName = curOpRes.inprog[0].desc; + const curOpRes = assert.commandWorked(db.adminCommand({currentOp: 1, client: myUri})); + threadName = curOpRes.inprog[0].desc; - assert.commandWorked(db.adminCommand({ - configureFailPoint: 'checkForInterruptFail', - mode: 'off', - })); - }; + assert.commandWorked(db.adminCommand({ + configureFailPoint: 'checkForInterruptFail', + mode: 'off', + })); +}; - const enableCheckForInterruptFailFP = function() { - const chance = TestData.checkForInterruptFailpointChance; +const enableCheckForInterruptFailFP = function() { + const chance = TestData.checkForInterruptFailpointChance; - assert.gte(chance, 0, "checkForInterruptFailpointChance must be >= 0"); - assert.lte(chance, 1, "checkForInterruptFailpointChance must be <= 1"); + assert.gte(chance, 0, "checkForInterruptFailpointChance must be >= 0"); + assert.lte(chance, 1, "checkForInterruptFailpointChance must be <= 1"); - assert.commandWorked(db.adminCommand({ - configureFailPoint: 'checkForInterruptFail', - mode: 'alwaysOn', - data: {threadName, chance}, - })); - }; + assert.commandWorked(db.adminCommand({ + configureFailPoint: 'checkForInterruptFail', + mode: 'alwaysOn', + data: {threadName, chance}, + })); +}; - defineFuzzerHooks({ - beforeServerInfo: disableCheckForInterruptFailFP, - afterServerInfo: enableCheckForInterruptFailFP, - }); +defineFuzzerHooks({ + beforeServerInfo: disableCheckForInterruptFailFP, + afterServerInfo: enableCheckForInterruptFailFP, +}); })(); |