summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorMoustafa Maher Khalil <m.maher@mongodb.com>2022-12-12 19:21:54 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-12 19:59:01 +0000
commitbe4ae87b04be821ebe9811aaf22437c10b1cf3b7 (patch)
tree0751b5231b57fa912cbfdfbfa92393e024bab7df /jstests
parent003fb8447adfb81705a8cc48fbdd6533381a61fa (diff)
downloadmongo-be4ae87b04be821ebe9811aaf22437c10b1cf3b7.tar.gz
SERVER-72011 Add the ability to load js files to fsm worker threads
Diffstat (limited to 'jstests')
-rw-r--r--jstests/concurrency/fsm_libs/worker_thread.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/concurrency/fsm_libs/worker_thread.js b/jstests/concurrency/fsm_libs/worker_thread.js
index 3e57fa1dfa1..f6fe4f784cd 100644
--- a/jstests/concurrency/fsm_libs/worker_thread.js
+++ b/jstests/concurrency/fsm_libs/worker_thread.js
@@ -36,6 +36,17 @@ var workerThread = (function() {
TestData = (TestData !== undefined) ? TestData : {};
try {
+ // Running a callback passed through testData before running fsm worker theads.
+ // Can be added to yml files as the following example:
+ // fsmPreOverridesLoadedCallback: '
+ // testingReplication = true;
+ // load('jstests/libs/override_methods/network_error_and_txn_override.js');
+ // ...
+ // '
+ if (typeof TestData.fsmPreOverridesLoadedCallback !== 'undefined') {
+ new Function(`${TestData.fsmPreOverridesLoadedCallback}`)();
+ }
+
if (typeof db !== 'undefined') {
// The implicit database connection created within the thread's scope
// is unneeded, so forcibly clean it up.