diff options
author | Alexander Neben <alexander.neben@mongodb.com> | 2022-12-27 19:19:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-27 19:40:00 +0000 |
commit | 14479283f175b888cb625e28efc62c12b5bbc284 (patch) | |
tree | 708820474ea3a1af87bf9dd6b965ef136c5216cf | |
parent | 7b84a36d62eaf6239444fca19d5c300750194eb2 (diff) | |
download | mongo-14479283f175b888cb625e28efc62c12b5bbc284.tar.gz |
SERVER-70553 Add module support to jstests
-rw-r--r-- | .eslintrc.yml | 4 | ||||
-rw-r--r-- | jstests/concurrency/fsm_libs/worker_thread.js | 2 | ||||
-rw-r--r-- | jstests/libs/parallelTester.js | 2 | ||||
-rw-r--r-- | jstests/noPassthrough/failcommand_failpoint_not_parallel.js | 2 | ||||
-rw-r--r-- | jstests/replsets/libs/secondary_reads_test.js | 4 | ||||
-rw-r--r-- | jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js | 2 |
6 files changed, 10 insertions, 6 deletions
diff --git a/.eslintrc.yml b/.eslintrc.yml index de2e6f3ba06..3bdb7d66a05 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -2,6 +2,10 @@ env: es6: true mongo: true +parserOptions: + ecmaVersion: 6 + sourceType: "module" + rules: # Rules are documented at http://eslint.org/docs/rules/ no-cond-assign: 2 diff --git a/jstests/concurrency/fsm_libs/worker_thread.js b/jstests/concurrency/fsm_libs/worker_thread.js index f1c39205adc..1d7cac969ec 100644 --- a/jstests/concurrency/fsm_libs/worker_thread.js +++ b/jstests/concurrency/fsm_libs/worker_thread.js @@ -220,7 +220,7 @@ var workerThread = (function() { // an exception. Nothing prior to (and including) args.latch.countDown() // should be wrapped in a try/catch statement. try { - args.latch.await(); // wait for all threads to start + args.latch.awaitLatch(); // wait for all threads to start Random.setRandomSeed(args.seed); run(configs); diff --git a/jstests/libs/parallelTester.js b/jstests/libs/parallelTester.js index 3777dbf4e8f..3dbc37a6ec2 100644 --- a/jstests/libs/parallelTester.js +++ b/jstests/libs/parallelTester.js @@ -428,7 +428,7 @@ if (typeof CountDownLatch !== 'undefined') { // prototype are lost during the serialization to BSON that occurs // when passing data to a child thread. - this.await = function() { + this.awaitLatch = function() { CountDownLatch._await(this._descriptor); }; this.countDown = function() { diff --git a/jstests/noPassthrough/failcommand_failpoint_not_parallel.js b/jstests/noPassthrough/failcommand_failpoint_not_parallel.js index 386e8c8f7e7..dedcc2add26 100644 --- a/jstests/noPassthrough/failcommand_failpoint_not_parallel.js +++ b/jstests/noPassthrough/failcommand_failpoint_not_parallel.js @@ -98,7 +98,7 @@ function startIncrementRunIdThread() { jsTest.log("Successfully applied update"); }, conn.name, kDbName, latch); thread.start(); - latch.await(); + latch.awaitLatch(); return thread; } diff --git a/jstests/replsets/libs/secondary_reads_test.js b/jstests/replsets/libs/secondary_reads_test.js index 192421827f8..90e6abe5614 100644 --- a/jstests/replsets/libs/secondary_reads_test.js +++ b/jstests/replsets/libs/secondary_reads_test.js @@ -99,8 +99,8 @@ function SecondaryReadsTest(name = "secondary_reads_test") { assert.gt(readers.length, 0, "no readers to stop"); assert.writeOK(primaryDB.getCollection(signalColl).insert({_id: testDoneId})); for (let i = 0; i < readers.length; i++) { - const await = readers[i]; - await (); + const awaitReader = readers[i]; + awaitReader(); print("reader " + i + " done"); } readers = []; diff --git a/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js b/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js index b4e31fd08a2..5e6250bc494 100644 --- a/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js +++ b/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js @@ -65,7 +65,7 @@ const removeOperationThreads = Array.from({length: kNumWriteTickets}).map(() => const conn = new Mongo(host); const testDB = conn.getDB(dbName); const coll = testDB.getCollection(collName); - insertLatch.await(); + insertLatch.awaitLatch(); assert.commandWorked(coll.remove({key: 200}, {justOne: true})); }, st.s.host, dbName, collName, insertLatch); }); |