Skip to content

Commit 900e68a

Browse files
committed
test(NODE-7195): inskip flaky test; clarify ignoreUndefined test case
1 parent 610fc05 commit 900e68a

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

test/integration/crud/find.test.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,7 @@ describe('Find', function () {
925925
// }
926926
// });
927927

928-
// TODO: NODE-3819: Unskip flaky tests.
929-
it.skip('should correctly iterate over collection', async function () {
928+
it('should correctly iterate over collection', async function () {
930929
const db = client.db(this.configuration.db);
931930

932931
const collection = db.collection('shouldCorrectlyIterateOverCollection');
@@ -947,7 +946,7 @@ describe('Find', function () {
947946
}
948947

949948
expect(iteratedCount).to.equal(500);
950-
}).skipReason = 'TODO(NODE-3819): flaky tests (on macOS)';
949+
});
951950

952951
it('should correctly error out findOneAndUpdate on duplicate record', async function () {
953952
const configuration = this.configuration;
@@ -1461,22 +1460,22 @@ describe('Find', function () {
14611460
// }
14621461
// });
14631462

1464-
it('Should correctly apply db level options to find cursor', async function () {
1463+
it('should correctly apply db level options to find cursor', async function () {
14651464
const configuration = this.configuration;
1466-
const client = configuration.newClient({}, { ignoreUndefined: true });
1467-
await client.connect();
1468-
const db = client.db(configuration.db);
1465+
const p_client = configuration.newClient({}, { ignoreUndefined: true });
1466+
await p_client.connect();
1467+
const db = p_client.db(configuration.db);
14691468
const collection = db.collection('test_find_simple_cursor_inheritance');
14701469

14711470
// Insert some test documents
14721471
await collection.insertMany([{ a: 2 }, { b: 3, c: undefined }]);
1473-
// Ensure correct insertion testing via the cursor and the count function
1474-
const cursor = collection.find({ c: undefined });
1472+
1473+
const cursor = collection.find({ c: { $exists: false } });
14751474

14761475
const documents = await cursor.toArray();
14771476
test.equal(2, documents.length);
1478-
// Let's close the db
1479-
await client.close();
1477+
1478+
await p_client.close();
14801479
});
14811480

14821481
it('should respect client-level read preference', {

0 commit comments

Comments
 (0)