Skip to content

Commit

Permalink
srv test
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-khare-mongoDB committed Jan 10, 2025
1 parent 3338fb9 commit e97cc3c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/integration/node-specific/client_close.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import { MongoClient } from 'mongodb-legacy';
import { type TestConfiguration } from '../../tools/runner/config';
import { runScriptAndGetProcessInfo } from './resource_tracking_script_builder';
import { expect } from 'chai';

describe.only('MongoClient.close() Integration', () => {
// note: these tests are set-up in accordance of the resource ownership tree
Expand Down Expand Up @@ -428,13 +430,13 @@ describe.only('MongoClient.close() Integration', () => {

describe('after SRVPoller is created', () => {
it.only('timers are cleaned up by client.close()', metadata, async () => {
const run = async function ({ MongoClient, uri, expect, sinon, getTimerCount }) {
const run = async function ({ MongoClient, uri, expect, getTimerCount }) {
const client = new MongoClient(uri);
await client.connect();
const description = client.topology.s.description;
// simulate transition to sharded
client.topology.emit('topologyDescriptionChanged', description, { ... description, type: 'Sharded'});
expect(client.topology.s.srvPoller?._timeout).to.exist;
client.topology.emit('topologyDescriptionChanged', description, { ... description, type: 'Sharded'});
expect(client.topology.s.srvPoller._timeout).to.exist;
await client.close();
expect(getTimerCount()).to.equal(0);
};
Expand Down

0 comments on commit e97cc3c

Please sign in to comment.