Skip to content

Conversation

jsaguet
Copy link

@jsaguet jsaguet commented Nov 30, 2023

Description:

After checking out the rxjs repo and running the unit tests, I noticed these 3 tests were always failing. (I'm running Windows 10 with Node 20)

The issue is probably that setTimeout does not necessarily execute at the specified delay.
I tried to reproduce the test in StackBlitz and I had the exact same issue when using timeouts so close to each other.

The PR updates these tests to use fake timers to make sure the tests work as expected.

@pmoleri
Copy link

pmoleri commented Feb 20, 2024

I had the same issue when running the tests on Windows 10 [email protected].
It's very annoying to contribute when there are unrelated failing tests.

I came across this interesting stackoverflow question: https://stackoverflow.com/questions/65177373/odd-behavior-with-setinterval-in-node-js-windows-only-works-in-linux that seems to explain the issue.

fakeTimers seems to be the way to go if we don't want to slow down the tests to be consistent in different platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants