Skip to content

Commit 325865e

Browse files
committed
wip
1 parent 7a8efc7 commit 325865e

File tree

7 files changed

+11
-14
lines changed

7 files changed

+11
-14
lines changed

src/mongo_client.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { TcpNetConnectOpts } from 'net';
22
import type { ConnectionOptions as TLSConnectionOptions, TLSSocketOptions } from 'tls';
3-
import { promisify } from 'util';
43

5-
import { Admin } from './admin';
64
import { BSONSerializeOptions, Document, resolveBSONOptions } from './bson';
75
import { ChangeStream, ChangeStreamDocument, ChangeStreamOptions } from './change_stream';
86
import type { AuthMechanismProperties, MongoCredentials } from './cmap/auth/mongo_credentials';

src/sdam/topology.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
import type { MongoClient, ServerApi } from '../mongo_client';
3333
import { TypedEventEmitter } from '../mongo_types';
3434
import { ReadPreference, ReadPreferenceLike } from '../read_preference';
35-
import type { ClientSession, ServerSessionId } from '../sessions';
35+
import type { ClientSession } from '../sessions';
3636
import type { Transaction } from '../transactions';
3737
import {
3838
Callback,

src/sessions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import { PromiseProvider } from './promise_provider';
2727
import { ReadConcernLevel } from './read_concern';
2828
import { ReadPreference } from './read_preference';
2929
import { _advanceClusterTime, ClusterTime, TopologyType } from './sdam/common';
30-
import type { Topology } from './sdam/topology';
3130
import { isTransactionCommand, Transaction, TransactionOptions, TxnState } from './transactions';
3231
import {
3332
calculateDurationInMs,

test/integration/auth/scram_sha_1.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('SCRAM-SHA-1', function () {
1919
});
2020

2121
afterEach(async () => {
22-
await client.close();
22+
await client?.close();
2323
});
2424

2525
it('successfuly authenticates', async () => {

test/integration/collection-management/collection.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,6 @@ describe('Collection', function () {
542542
await collection.insertOne({ a: 'c' });
543543
});
544544

545-
afterEach(async function () {
546-
await client.close();
547-
});
548-
549545
afterEach(async function () {
550546
await collection.drop();
551547
await client.close();

test/integration/crud/find_cursor_methods.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ describe('Find Cursor', function () {
213213
});
214214
});
215215

216-
context('#rewind', function () {
216+
context.skip('#rewind', function () {
217217
it('should rewind a cursor', function (done) {
218218
const coll = client.db().collection('abstract_cursor');
219219
const cursor = coll.find({});

test/tools/runner/hooks/session_leak_checker.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ServerSessionPool.prototype.release = function (...args) {
1717
return originalRelease.call(this, ...args);
1818
};
1919

20-
const sessionLeakCheckBeforeEach: Mocha.Func = function sessionLeakCheckBeforeEach() {
20+
const sessionLeakCheckBeforeEach: Mocha.Func = async function sessionLeakCheckBeforeEach() {
2121
if (this.currentTest?.metadata?.sessions?.skipLeakTests) {
2222
return;
2323
}
@@ -27,14 +27,18 @@ const sessionLeakCheckBeforeEach: Mocha.Func = function sessionLeakCheckBeforeEa
2727
releaseCount = 0;
2828
};
2929

30-
const sessionLeakCheckAfterEach: Mocha.Func = function sessionLeakCheckAfterEach() {
30+
const sessionLeakCheckAfterEach: Mocha.Func = async function sessionLeakCheckAfterEach() {
3131
if (this.currentTest?.state === 'failed' || this.currentTest?.metadata?.sessions?.skipLeakTests) {
3232
return;
3333
}
3434

3535
const title = this.currentTest.fullTitle();
36-
37-
expect(acquireCount, `"${title}" failed to release all sessions`).to.equal(releaseCount);
36+
try {
37+
expect(acquireCount, `"${title}" failed to release all sessions`).to.equal(releaseCount);
38+
} catch (error) {
39+
// @ts-expect-error: internal mocha api
40+
this.test.error(error);
41+
}
3842
};
3943

4044
module.exports = {

0 commit comments

Comments
 (0)