diff options
author | Alexander Neben <alexander.neben@mongodb.com> | 2022-12-27 19:20:05 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-27 19:33:51 +0000 |
commit | 157eee46937d53fe4d02a26663a333ffc8996c3d (patch) | |
tree | e4a11773d72095490ba57e5a909c344d33584db4 | |
parent | 07aad3da793d5d1dead0814eb6b8d05da9304866 (diff) | |
download | mongo-157eee46937d53fe4d02a26663a333ffc8996c3d.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 7e237e6257b..315b7964c6e 100644 --- a/jstests/concurrency/fsm_libs/worker_thread.js +++ b/jstests/concurrency/fsm_libs/worker_thread.js @@ -217,7 +217,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 6bdaf792b58..7af2e7a4eab 100644 --- a/jstests/libs/parallelTester.js +++ b/jstests/libs/parallelTester.js @@ -419,7 +419,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 f60ad7146d1..beba2f4aa1a 100644 --- a/jstests/noPassthrough/failcommand_failpoint_not_parallel.js +++ b/jstests/noPassthrough/failcommand_failpoint_not_parallel.js @@ -100,7 +100,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 1d712fce05a..fb0fa5e2771 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.commandWorked(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 1e8d5251a0d..ff29484d658 100644 --- a/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js +++ b/jstests/sharding/cancel_coordinate_txn_commit_with_tickets_exhausted.js @@ -61,7 +61,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); }); |