Skip to content

Commit 3182e8d

Browse files
authored
test(NODE-4082): session spec prose test language clean up (#3187)
1 parent e92957a commit 3182e8d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/integration/sessions/sessions.spec.prose.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { expect } from 'chai';
22

3-
import { Collection } from '../../../src/index';
3+
import type { Collection, CommandStartedEvent, MongoClient } from '../../../src/index';
44

55
describe('ServerSession', () => {
6-
let client;
6+
let client: MongoClient;
77
let testCollection: Collection<{ _id: number; a?: number }>;
88
beforeEach(async function () {
99
const configuration = this.configuration;
@@ -19,14 +19,14 @@ describe('ServerSession', () => {
1919
});
2020

2121
/**
22-
* TODO(NODE-4082): Refactor tests to align exactly with spec wording.
23-
* Assert the following across at least 5 retries of the above test: (We do not need to retry in nodejs)
22+
* Create a MongoClient with the following options: maxPoolSize=1 and retryWrites=true
23+
* Attach a command started listener that collects each command's lsid
2424
* Drivers MUST assert that exactly one session is used for all operations at least once across the retries of this test.
2525
* Note that it's possible, although rare, for greater than 1 server session to be used because the session is not released until after the connection is checked in.
26-
* Drivers MUST assert that the number of allocated sessions is strictly less than the number of concurrent operations in every retry of this test. In this instance it would less than (but NOT equal to) 8.
26+
* Drivers MUST assert that the number of allocated sessions is strictly less than the number of concurrent operations in every retry of this test. In this instance it would be less than (but NOT equal to) 8.
2727
*/
2828
it('13. may reuse one server session for many operations', async () => {
29-
const events = [];
29+
const events: CommandStartedEvent[] = [];
3030
client.on('commandStarted', ev => events.push(ev));
3131

3232
const operations = [

0 commit comments

Comments
 (0)