mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix blocking realpathSync call (#26056)
### What does this PR do? ### How did you verify your code works? --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
import { describe, expect, it, spyOn } from "bun:test";
|
||||
import { bunEnv, bunExe, gc, getMaxFD, isBroken, isIntelMacOS, isWindows, tempDirWithFiles, tmpdirSync } from "harness";
|
||||
import {
|
||||
bunEnv,
|
||||
bunExe,
|
||||
gc,
|
||||
getMaxFD,
|
||||
isBroken,
|
||||
isIntelMacOS,
|
||||
isPosix,
|
||||
isWindows,
|
||||
tempDirWithFiles,
|
||||
tmpdirSync,
|
||||
} from "harness";
|
||||
import { isAscii } from "node:buffer";
|
||||
import fs, {
|
||||
closeSync,
|
||||
@@ -51,6 +62,7 @@ import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { spawnSync } from "bun";
|
||||
import { mkfifo } from "mkfifo";
|
||||
import { ReadStream as ReadStream_, WriteStream as WriteStream_ } from "./export-from.js";
|
||||
import { ReadStream as ReadStreamStar_, WriteStream as WriteStreamStar_ } from "./export-star-from.js";
|
||||
|
||||
@@ -1540,6 +1552,13 @@ it("symlink", () => {
|
||||
expect(realpathSync(actual)).toBe(realpathSync(import.meta.path));
|
||||
});
|
||||
|
||||
it.if(isPosix)("realpathSync doesn't block on FIFO", () => {
|
||||
const path = join(tmpdirSync(), "test-fs-fifo-block.fifo");
|
||||
mkfifo(path, 0o666);
|
||||
realpathSync(path);
|
||||
unlinkSync(path);
|
||||
});
|
||||
|
||||
it("readlink", () => {
|
||||
const actual = join(tmpdirSync(), "fs-readlink.txt");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user