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

process.chdir issue on Windows test run: EBUSY: Device or resource busy #11904

Open
nobkd opened this issue Jun 16, 2024 · 0 comments
Open

process.chdir issue on Windows test run: EBUSY: Device or resource busy #11904

nobkd opened this issue Jun 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working windows An issue that only occurs on Windows

Comments

@nobkd
Copy link

nobkd commented Jun 16, 2024

What version of Bun is running?

1.1.13+bd6a60512

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

process.chdir() in a test on Windows to a directory (except node_modules, or directories starting with a dot, e.g. .dirname, maybe more, but those are the ones I found)

Minimal Reproduction (run twice or create _mytestdir by hand before running code once):

// minimal.test.js
import {test} from 'bun:test'
import {existsSync, mkdirSync} from 'node:fs'

const testdir = '_mytestdir'
if (!existsSync(testdir)) mkdirSync(testdir)

test('minimal test', () => {
	process.chdir(testdir)
})

Larger example: https://github.com/nobkd/bun-chdir-device-busy-repro (test run)

What is the expected behavior?

bun test v1.1.13 (bd6a6051)

minimal.test.js:
 minimal test

 1 pass
 0 fail
Ran 1 tests across 1 files. [106.00ms]

What do you see instead?

bun test v1.1.13 (bd6a6051)

minimal.test.js:
3 |
4 | const testdir = 'mytestdir'
5 | if (!existsSync(testdir)) mkdirSync(testdir)
6 |
7 | test('minimal test', () => {
8 |     process.chdir(testdir)
             ^
EBUSY: Device or resource busy
   errno: -16
 syscall: "chdir"

      at C:\Users\nobkd\Desktop\bun-chdir-device-busy-repro\minimal.test.js:8:10
 minimal test

 0 pass
 1 fail
Ran 1 tests across 1 files. [121.00ms]

Additional information

  • Windows only issue
  • Test only issue

Note: This issue doesn't really block me, it's just something that I encountered by chance.

@nobkd nobkd added bug Something isn't working needs triage labels Jun 16, 2024
@paperdave paperdave added windows An issue that only occurs on Windows and removed needs triage labels Jun 17, 2024
@paperdave paperdave self-assigned this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows An issue that only occurs on Windows
Projects
None yet
Development

No branches or pull requests

2 participants