Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix a few flaky CSOT tests #4278

Merged
merged 8 commits into from
Oct 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comments
baileympearson committed Oct 15, 2024

Verified

This commit was signed with the committer’s verified signature.
baileympearson Bailey Pearson
commit 55ede467250f19826bf755aa4149d495ffcaff63
25 changes: 15 additions & 10 deletions test/integration/client-side-operations-timeout/node_csot.test.ts
Original file line number Diff line number Diff line change
@@ -461,16 +461,21 @@ describe('CSOT driver tests', metadata, () => {
.project({ _id: 0 });
await cursor.toArray();

expect(commandStarted).to.have.length.gte(3); // Find and 2 getMores

expect(
commandStarted.filter(ev => {
return (
(ev.command.find != null && ev.command.maxTimeMS != null) ||
(ev.command.getMore != null && ev.command.maxTimeMS != null)
);
})
).to.have.lengthOf(0);
const commands = commandStarted.filter(c =>
['find', 'getMore'].includes(c.commandName)
);
expect(commands).to.have.lengthOf(4); // Find and 2 getMores

const [
{ command: aggregate },
{ command: getMore1 },
{ command: getMore2 },
{ command: getMore3 }
] = commands;
expect(aggregate).not.to.have.property('maxTimeMS');
expect(getMore1).not.to.have.property('maxTimeMS');
expect(getMore2).not.to.have.property('maxTimeMS');
expect(getMore3).not.to.have.property('maxTimeMS');
}
);
});