oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.1k stars 2.76k forks source link

`bun test` hangs with 100 CPU usage on MacOS Ventura #6264

Open DoctorGester opened 1 year ago

DoctorGester commented 1 year ago

What version of Bun is running?

1.0.4+745b6b94ee56cad24d475799690cc9a89957d15b

What platform is your computer?

Darwin 22.6.0 arm64 arm

What steps can reproduce the bug?

git clone -b isolated-modules https://github.com/DoctorGester/TypescriptToLua.git
cd TypescriptToLua
bun install
bun test

What is the expected behavior?

Bun test completes

What do you see instead?

Bun test hangs forever while fully using a single core on nullish-coalescing with generic lhs test

Additional information

No response

cyfung1031 commented 1 year ago

MacOS Monterey 12.6.1

Screen Shot 2023-10-03 at 23 43 42
Jarred-Sumner commented 1 year ago

This is happening for two reasons: 1) expect, test and others are only auto-imported inside test files. Their use in util.ts is not a test file. I suspect we'll need to change these in the future to work more similar to Jest for compatibility 2) The above causes an exception, and some code somewhere appears to be ignoring the exception which leads to the error above

DoctorGester commented 7 months ago

@Jarred-Sumner I have tried this again with 1.1. I have replaced all expect and test calls with bun:test imports. After another bunch of changes due to different testing framework bugs I now have tests passing. This specific test however still hangs and eats 100% CPU even though there is no error in console.