bun icon indicating copy to clipboard operation
bun copied to clipboard

bun:test freezes (command never exits) after upgrading to 1.0.24

Open EvHaus opened this issue 1 year ago • 3 comments

What version of Bun is running?

1.0.24+6fa35839c

What platform is your computer?

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

After upgrading from 1.0.23 to 1.0.24, Bun is freezing (never quits) after running my tests via bun:test. Downgrading to 1.0.23 fixes the issue.

Steps to reproduce:

  • Clone this repo: https://github.com/EvHaus/test-runner-benchmarks
  • Run cd benchmarks/bun
  • Run bun i
  • Run bun run test
  • BUG: Tests will be stuck and never exit

If you downgrade to 1.0.23, you'll see it works fine.

UPDATE: Still an issue with 1.0.28 and 1.0.29+a146856d canary

What is the expected behavior?

Tests run and complete (like in 1.0.23)

What do you see instead?

Process never exists. Stuck forever.

EvHaus avatar Jan 21 '24 01:01 EvHaus

@nektro this is probably the isEventLoopActive change

Jarred-Sumner avatar Jan 21 '24 01:01 Jarred-Sumner

This issue is still blocking us from upgrading bun to any version above 1.0.23.

Tests are running fine with 1.0.23 and are just hanging with no error on versions above.

Did anyone manage to fix it for them? The problem persists also with the latest 1.0.35 version.

vedmakk avatar Mar 26 '24 05:03 vedmakk

Same on 1.1.1 and 1.1.3

garrettg123 avatar Apr 09 '24 18:04 garrettg123

I have the same issue. The tests run properly with bun v1.0.23 but freeze with bun 1.0.24. It also freezes with bun 1.0.36 (latest 1.0 version) and bun 1.1.3 (latest version).

Amatewasu avatar Apr 10 '24 12:04 Amatewasu

Had this issue running tests in a React app project. Upgrading Vite and Happy-dom dependencies resolved the issue for me.

vladmundi-mettle avatar Apr 15 '24 12:04 vladmundi-mettle

Thanks @vladmundi-mettle. That's true. Using the latest dependencies I can't reproduce this anymore. Will close.

EvHaus avatar Apr 16 '24 05:04 EvHaus

@EvHaus btw in the test-runner-benchmarks repo, the "should be able to toggle the collapsible content" test seems to be taking up much of the time in bun test.

Commented out: image

Not commented out: image

I think it's because we haven't implemented jest fake timers yet

Jarred-Sumner avatar Apr 16 '24 05:04 Jarred-Sumner

@Jarred-Sumner Thanks for looking at it again. That test doesn't use Jest timers though. It uses @testing-library/react's waitForElementToBeRemoved (which uses setInterval under-the-hood).

EvHaus avatar Apr 16 '24 06:04 EvHaus