Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions scripts/runner.node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,7 @@ async function spawnBun(execPath, { args, cwd, timeout, gracefulTimeout, idleTim
FORCE_COLOR: "1",
BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING: "1",
BUN_DEBUG_QUIET_LOGS: "1",
BUN_DISABLE_SLOW_FILESYSTEM_WARNING: "1",
BUN_GARBAGE_COLLECTOR_LEVEL: "1",
BUN_JSC_randomIntegrityAuditRate: "1.0",
BUN_RUNTIME_TRANSPILER_CACHE_PATH: "0",
Expand Down
3 changes: 3 additions & 0 deletions src/bun_core/env_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ pub mod feature_flag {
// Fall back to the scalar byte-at-a-time VLQ decode in
// bun_sourcemap::mapping::parse (skips the Highway-dispatched path).
new_feature_flag!(pub BUN_FEATURE_FLAG_DISABLE_SIMD_SOURCEMAP, "BUN_FEATURE_FLAG_DISABLE_SIMD_SOURCEMAP", {});
// Suppress the `bun install` "Slow filesystem detected" warning. Set by the
// test harness so stderr assertions don't flake on slow CI filesystems.
Comment thread
robobun marked this conversation as resolved.
Outdated
new_feature_flag!(pub BUN_DISABLE_SLOW_FILESYSTEM_WARNING, "BUN_DISABLE_SLOW_FILESYSTEM_WARNING", {});
new_feature_flag!(pub BUN_DISABLE_SLOW_LIFECYCLE_SCRIPT_LOGGING, "BUN_DISABLE_SLOW_LIFECYCLE_SCRIPT_LOGGING", {});
new_feature_flag!(pub BUN_DISABLE_SOURCE_CODE_PREVIEW, "BUN_DISABLE_SOURCE_CODE_PREVIEW", {});
new_feature_flag!(pub BUN_FEATURE_FLAG_DISABLE_SOURCE_MAPS, "BUN_FEATURE_FLAG_DISABLE_SOURCE_MAPS", {});
Expand Down
10 changes: 7 additions & 3 deletions src/install/PackageManager/PackageManagerDirectories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ fn get_temporary_directory_run(manager: &mut PackageManager) -> TemporaryDirecto
let tmpname =
FileSystem::tmpname(b"hm", &mut tmpbuf, bun_core::fast_random()).expect("unreachable");

let mut timer = if manager.options.log_level != LogLevel::Silent {
let mut timer = if manager.options.log_level != LogLevel::Silent
&& !bun_core::env_var::feature_flag::BUN_DISABLE_SLOW_FILESYSTEM_WARNING
.get()
.unwrap_or(false)
{
Some(bun_core::time::Timer::start())
} else {
None
Expand Down Expand Up @@ -272,8 +276,8 @@ fn get_temporary_directory_run(manager: &mut PackageManager) -> TemporaryDirecto
break;
}

if manager.options.log_level != LogLevel::Silent {
let elapsed = timer.as_mut().unwrap().read();
if let Some(timer) = timer.as_mut() {
let elapsed = timer.read();
if elapsed > bun_core::time::NS_PER_MS * 100 {
let mut path_buf = PathBuffer::uninit();
let cache_dir_path: &[u8] = match sys::get_fd_path(cache_directory_fd, &mut path_buf) {
Expand Down
4 changes: 2 additions & 2 deletions test/cli/install/bun-run-dir.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ for (const entry of await decompress(Buffer.from(buffer))) {
BUN_INSTALL_CACHE_DIR: join(run_dir, ".cache"),
},
});
const err2 = await new Response(stderr2).text();
if (err2) throw new Error(err2);
const err2 = stderrForInstall(await new Response(stderr2).text());
expect(err2).toBe("");
expect(await readdirSorted(run_dir)).toEqual([".cache", "test.js"]);
expect(await readdirSorted(join(run_dir, ".cache"))).toContain("decompress");
expect(await readdirSorted(join(run_dir, ".cache", "decompress"))).toEqual(["4.2.1@@@1"]);
Expand Down
5 changes: 4 additions & 1 deletion test/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export const bunEnv: NodeJS.Dict<string> = {
CI: "1",
BUN_RUNTIME_TRANSPILER_CACHE_PATH: "0",
BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING: "1",
// The `bun install` "Slow filesystem detected" warning is timing-dependent
// and flakes stderr assertions on slow CI filesystems.
BUN_DISABLE_SLOW_FILESYSTEM_WARNING: "1",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
// Tests drive `bun update --interactive` by writing keystrokes to a pipe;
// the real command refuses on non-TTY stdin. Bypass that gate under test.
BUN_INTERNAL_INTERACTIVE_ASSUME_TTY: "1",
Expand Down Expand Up @@ -1513,7 +1516,7 @@ export async function runBunInstall(

// stderr with `slow filesystem` warning removed
export function stderrForInstall(err: string) {
return err.replace(/warn: Slow filesystem.*/g, "");
return err.replace(/warn: Slow filesystem.*\r?\n?/g, "");
}

export async function runBunUpdate(
Expand Down
Loading