Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ functions:
params:
env:
TEST_CSFLE: "true"
NODE_OPTIONS: "--max-old-space-size=64"
add_expansions_to_env: true
working_dir: "src"
timeout_secs: 300
Expand Down
1 change: 1 addition & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ functions:
params:
env:
TEST_CSFLE: 'true'
NODE_OPTIONS: '--max-old-space-size=64'
add_expansions_to_env: true
working_dir: src
timeout_secs: 300
Expand Down
41 changes: 40 additions & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,43 @@ export MONGODB_URI=${MONGODB_URI}
export LOAD_BALANCER=${LOAD_BALANCER}
export TEST_CSFLE=${TEST_CSFLE}
export COMPRESSOR=${COMPRESSOR}
npm run check:integration-coverage

# OOM exit code investigation - run through each layer and log exit codes
set +e

OOM_TEST="test/integration/oom.test.ts"

echo "========================================="
echo "Layer 1: direct mocha"
echo "========================================="
npx mocha --config test/mocha_mongodb.js "$OOM_TEST"
echo "EXIT CODE: $?"

echo "========================================="
echo "Layer 2: npm run check:test (npm -> mocha)"
echo "========================================="
npm run check:test -- "$OOM_TEST"
echo "EXIT CODE: $?"

echo "========================================="
echo "Layer 3: nyc mocha (nyc -> mocha, no npm)"
echo "========================================="
npx nyc mocha --config test/mocha_mongodb.js "$OOM_TEST"
echo "EXIT CODE: $?"

echo "========================================="
echo "Layer 4: nyc npm run check:test (nyc -> npm -> mocha)"
echo "========================================="
npx nyc npm run check:test -- "$OOM_TEST"
echo "EXIT CODE: $?"

echo "========================================="
echo "Layer 5: npm run check:integration-coverage (npm -> nyc -> npm -> mocha)"
echo "========================================="
npm run check:integration-coverage -- "$OOM_TEST"
echo "EXIT CODE: $?"

echo "========================================="
echo "DONE - any EXIT CODE of 0 above means that layer swallows the OOM"
echo "========================================="
exit 1
8 changes: 8 additions & 0 deletions test/integration/oom.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe.only('OOM exit code detection', function () {
it('allocates until OOM', function () {
const leak: object[] = [];
while (true) {
leak.push({ a: Array.from({ length: 1_000 }, (_, i) => ({ i })) });
}
});
});