Skip to content

Commit 978ee0a

Browse files
ShogunPandamarco-ippolito
authored andcommittedJun 17, 2024
src: only apply fix in main thread
PR-URL: #52702 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 8fc52b3 commit 978ee0a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎test/parallel/test-process-load-env-file.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,17 @@ describe('process.loadEnvFile()', () => {
5858
const originalCwd = process.cwd();
5959

6060
try {
61-
process.chdir(join(originalCwd, 'lib'));
61+
if (common.isMainThread) {
62+
process.chdir(join(originalCwd, 'lib'));
63+
}
6264

6365
assert.throws(() => {
6466
process.loadEnvFile();
6567
}, { code: 'ENOENT', syscall: 'open', path: '.env' });
6668
} finally {
67-
process.chdir(originalCwd);
69+
if (common.isMainThread) {
70+
process.chdir(originalCwd);
71+
}
6872
}
6973
});
7074

0 commit comments

Comments
 (0)
Please sign in to comment.