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

test: skip sea tests with more accurate available disk space estimation #53996

Merged
merged 1 commit into from
Jul 27, 2024
Merged
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
11 changes: 7 additions & 4 deletions test/common/sea.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const fixtures = require('../common/fixtures');
const tmpdir = require('../common/tmpdir');
const { inspect } = require('util');

const { readFileSync, copyFileSync } = require('fs');
const { readFileSync, copyFileSync, statSync } = require('fs');
const {
spawnSyncAndExitWithoutError,
} = require('../common/child_process');
Expand Down Expand Up @@ -53,9 +53,12 @@ function skipIfSingleExecutableIsNotSupported() {
tmpdir.refresh();

// The SEA tests involve making a copy of the executable and writing some fixtures
// to the tmpdir. To be safe, ensure that at least 120MB disk space is available.
if (!tmpdir.hasEnoughSpace(120 * 1024 * 1024)) {
common.skip('Available disk space < 120MB');
// to the tmpdir. To be safe, ensure that the disk space has at least a copy of the
// executable and some extra space for blobs and configs is available.
const stat = statSync(process.execPath);
const expectedSpace = stat.size + 10 * 1024 * 1024;
if (!tmpdir.hasEnoughSpace(expectedSpace)) {
common.skip(`Available disk space < ${Math.floor(expectedSpace / 1024 / 1024)} MB`);
}
}

Expand Down
Loading