Skip to content

Commit 07d6cb1

Browse files
fix server api tests
1 parent 9708920 commit 07d6cb1

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

.evergreen/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,8 @@ tasks:
17011701
- {key: REQUIRE_API_VERSION, value: '1'}
17021702
- {key: MONGODB_API_VERSION, value: '1'}
17031703
- {key: AUTH, value: auth}
1704+
- {key: TEST_CSFLE, value: 'true'}
1705+
- {key: CLIENT_ENCRYPTION, value: 'true'}
17041706
- func: install dependencies
17051707
- func: bootstrap mongo-orchestration
17061708
- func: bootstrap kms servers
@@ -1881,6 +1883,8 @@ tasks:
18811883
- {key: TOPOLOGY, value: replica_set}
18821884
- {key: TEST_SOCKS5_CSFLE, value: 'true'}
18831885
- {key: AUTH, value: auth}
1886+
- {key: CLIENT_ENCRYPTION, value: 'true'}
1887+
- {key: TEST_CSFLE, value: 'true'}
18841888
- func: install dependencies
18851889
- func: bootstrap mongo-orchestration
18861890
- func: bootstrap kms servers
@@ -1897,6 +1901,8 @@ tasks:
18971901
- {key: TOPOLOGY, value: replica_set}
18981902
- {key: TEST_SOCKS5_CSFLE, value: 'true'}
18991903
- {key: AUTH, value: noauth}
1904+
- {key: CLIENT_ENCRYPTION, value: 'true'}
1905+
- {key: TEST_CSFLE, value: 'true'}
19001906
- func: install dependencies
19011907
- func: bootstrap mongo-orchestration
19021908
- func: bootstrap kms servers

.evergreen/generate_evergreen_tasks.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ BASE_TASKS.push({
105105
TOPOLOGY: 'server',
106106
REQUIRE_API_VERSION: '1',
107107
MONGODB_API_VERSION: '1',
108-
AUTH: 'auth'
108+
AUTH: 'auth',
109+
TEST_CSFLE: 'true',
110+
CLIENT_ENCRYPTION: 'true'
109111
}),
110112
{ func: 'install dependencies' },
111113
{ func: 'bootstrap mongo-orchestration' },
@@ -187,7 +189,9 @@ TASKS.push(
187189
VERSION: 'latest',
188190
TOPOLOGY: 'replica_set',
189191
TEST_SOCKS5_CSFLE: 'true',
190-
AUTH: 'auth'
192+
AUTH: 'auth',
193+
CLIENT_ENCRYPTION: 'true',
194+
TEST_CSFLE: 'true'
191195
}),
192196
{ func: 'install dependencies' },
193197
{ func: 'bootstrap mongo-orchestration' },
@@ -203,7 +207,9 @@ TASKS.push(
203207
VERSION: 'latest',
204208
TOPOLOGY: 'replica_set',
205209
TEST_SOCKS5_CSFLE: 'true',
206-
AUTH: 'noauth'
210+
AUTH: 'noauth',
211+
CLIENT_ENCRYPTION: 'true',
212+
TEST_CSFLE: 'true'
207213
}),
208214
{ func: 'install dependencies' },
209215
{ func: 'bootstrap mongo-orchestration' },

test/integration/client-side-operations-timeout/client_side_operations_timeout.unit.test.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
CSOTTimeoutContext,
1919
type MongoClient,
2020
MongoOperationTimeoutError,
21+
ObjectId,
2122
Timeout,
2223
TimeoutContext,
2324
Topology
@@ -90,20 +91,20 @@ describe('CSOT spec unit tests', function () {
9091
/* eslint-disable @typescript-eslint/no-empty-function */
9192
context.skip(
9293
'If a new connection is required to execute an operation, min(remaining computedServerSelectionTimeout, connectTimeoutMS) should apply to socket establishment.',
93-
() => {}
94+
() => { }
9495
).skipReason =
9596
'TODO(DRIVERS-2347): Requires this ticket to be implemented before we can assert on connection CSOT behaviour';
9697

9798
context(
9899
'For drivers that have control over OCSP behavior, min(remaining computedServerSelectionTimeout, 5 seconds) should apply to HTTP requests against OCSP responders.',
99-
() => {}
100+
() => { }
100101
);
101102
});
102103

103104
context.skip('Socket timeouts', function () {
104105
context(
105106
'If timeoutMS is unset, operations fail after two non-consecutive socket timeouts.',
106-
() => {}
107+
() => { }
107108
);
108109
}).skipReason =
109110
'TODO(NODE-6518): Add CSOT support for socket read/write at the connection layer for CRUD APIs';
@@ -112,7 +113,7 @@ describe('CSOT spec unit tests', function () {
112113
describe('KMS requests', function () {
113114
const stateMachine = new StateMachine({} as any);
114115
const request = {
115-
addResponse: _response => {},
116+
addResponse: _response => { },
116117
status: {
117118
type: 1,
118119
code: 1,
@@ -126,7 +127,7 @@ describe('CSOT spec unit tests', function () {
126127

127128
context('when StateMachine.kmsRequest() is passed a `CSOTimeoutContext`', function () {
128129
beforeEach(async function () {
129-
sinon.stub(TLSSocket.prototype, 'connect').callsFake(function (..._args) {});
130+
sinon.stub(TLSSocket.prototype, 'connect').callsFake(function (..._args) { });
130131
});
131132

132133
afterEach(async function () {
@@ -195,11 +196,10 @@ describe('CSOT spec unit tests', function () {
195196
{
196197
autoEncryption: {
197198
extraOptions: {
198-
mongocryptdBypassSpawn: true,
199-
mongocryptdURI: 'mongodb://localhost:27017/db?serverSelectionTimeoutMS=1000',
199+
mongocryptdURI: 'mongodb://localhost:27020/db?serverSelectionTimeoutMS=2000',
200200
mongocryptdSpawnArgs: [
201-
'--pidfilepath=bypass-spawning-mongocryptd.pid',
202-
'--port=27017'
201+
`--pidfilepath=${new ObjectId().toHexString()}.pid`,
202+
'--port=27020'
203203
]
204204
},
205205
keyVaultNamespace: 'admin.datakeys',
@@ -211,6 +211,7 @@ describe('CSOT spec unit tests', function () {
211211
timeoutMS
212212
}
213213
);
214+
214215
await encryptedClient.connect();
215216

216217
const stub = sinon
@@ -249,7 +250,7 @@ describe('CSOT spec unit tests', function () {
249250
context.skip('Background Connection Pooling', function () {
250251
context(
251252
'When doing minPoolSize maintenance, connectTimeoutMS is used as the timeout for socket establishment.',
252-
() => {}
253+
() => { }
253254
);
254255
}).skipReason = 'TODO(NODE-6091): Implement CSOT logic for Background Connection Pooling';
255256
/* eslint-enable @typescript-eslint/no-empty-function */

test/tools/runner/config.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ export class TestConfiguration {
116116
replicaSet: url.searchParams.get('replicaSet'),
117117
proxyURIParams: url.searchParams.get('proxyHost')
118118
? {
119-
proxyHost: url.searchParams.get('proxyHost'),
120-
proxyPort: Number(url.searchParams.get('proxyPort')),
121-
proxyUsername: url.searchParams.get('proxyUsername'),
122-
proxyPassword: url.searchParams.get('proxyPassword')
123-
}
119+
proxyHost: url.searchParams.get('proxyHost'),
120+
proxyPort: Number(url.searchParams.get('proxyPort')),
121+
proxyUsername: url.searchParams.get('proxyUsername'),
122+
proxyPassword: url.searchParams.get('proxyPassword')
123+
}
124124
: undefined
125125
};
126126
if (url.username) {
@@ -198,7 +198,6 @@ export class TestConfiguration {
198198

199199
newClient(urlOrQueryOptions?: string | Record<string, any>, serverOptions?: MongoClientOptions) {
200200
serverOptions = Object.assign({}, getEnvironmentalOptions(), serverOptions);
201-
202201
// Support MongoClient constructor form (url, options) for `newClient`.
203202
if (typeof urlOrQueryOptions === 'string') {
204203
if (Reflect.has(serverOptions, 'host') || Reflect.has(serverOptions, 'port')) {

0 commit comments

Comments
 (0)