Skip to content

Commit 1685623

Browse files
committed
fixup! chore: verify we only encounter expected MongoDB server warnings MONGOSH-2988
1 parent b0e3f99 commit 1685623

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

packages/e2e-tests/test/e2e-oidc.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,15 @@ describe('OIDC auth e2e', function () {
116116
...commonOidcServerArgs,
117117
],
118118
});
119+
// The server will (rightfully) complain about the mock IdP's TLS certificate
120+
// not being trusted - we can ignore that for the purposes of this test.
121+
testServer2.allowWarning(
122+
(entry) =>
123+
entry.id === 7938401 &&
124+
entry.attr?.error?.includes(
125+
'SSL peer certificate or SSH remote key was not OK'
126+
)
127+
);
119128
testServer3 = new MongoRunnerSetup('e2e-oidc-test-idtoken', {
120129
args: [
121130
'--setParameter',

packages/e2e-tests/test/e2e-proxy.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,15 @@ describe('e2e proxy support', function () {
426426
...commonOidcServerArgs,
427427
],
428428
});
429+
// The server will (rightfully) complain about the mock IdP's TLS certificate
430+
// not being trusted - we can ignore that for the purposes of this test.
431+
oidcTestServer.allowWarning(
432+
(entry) =>
433+
entry.id === 7938401 &&
434+
entry.attr?.error?.includes(
435+
'SSL peer certificate or SSH remote key was not OK'
436+
)
437+
);
429438
await oidcTestServer.start();
430439
});
431440

packages/e2e-tests/test/e2e.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2722,7 +2722,7 @@ describe('e2e', function () {
27222722
-1
27232723
);
27242724

2725-
void helperShell.executeLine(
2725+
const currentCommand = helperShell.executeLine(
27262726
`db.coll.find({$where: function() { sleep(${OPERATION_TIME}) }}).projection({re: BSONRegExp('${stringifiedRegExpString}')})`
27272727
);
27282728
helperShell.assertNoErrors();
@@ -2735,6 +2735,7 @@ describe('e2e', function () {
27352735
currentOpShell.assertNoErrors();
27362736

27372737
expect(currentOpCall).to.include(stringifiedRegExpString);
2738+
await currentCommand;
27382739
});
27392740
});
27402741
});

testing/integration-testing-hooks.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,15 @@ export class MongoRunnerSetup extends MongodSetup {
228228
7012500, // "Failed to refresh query analysis configurations", normal sharding behavior
229229
4906901, // "Arbiters are not supported in quarterly binary versions"
230230
6100702, // "Failed to get last stable recovery timestamp due to lock acquire timeout. Note this is expected if shutdown is in progress."
231+
20525, // "Failed to gather storage statistics for slow operation"
232+
22120, // "Access control is not enabled for the database"
233+
22140, // "This server is bound to localhost"
234+
22178, // "transparent_hugepage/enabled is 'always'"
235+
5123300, // "vm.max_map_count is too low"
236+
551190, // "Server certificate has no compatible Subject Alternative Name",
237+
20526, // "Failed to gather storage statistics for slow operation"
231238
(l: LogEntry) => l.component === 'STORAGE', // Outside of mongosh's control
239+
(l: LogEntry) => l.context === 'BackgroundSync', // Outside of mongosh's control
232240
(l: LogEntry) => {
233241
// "Aggregate command executor error", we get this a lot for things like
234242
// $collStats which internally tries to open collections that may or may not exist

0 commit comments

Comments
 (0)