chore(test): use fakeTimers with setTimeout in buffer, skipUntil and window - #7392
chore(test): use fakeTimers with setTimeout in buffer, skipUntil and window#7392jsaguet wants to merge 1 commit into
Conversation
|
I had the same issue when running the tests on Windows 10 node@18.18.2. 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.
|
|
Hi @jsaguet — thank you for the time, care, and thoughtfulness you put into this pull request. I’m sorry we weren’t able to respond in a reasonable timeframe. Since the codebase and surrounding context have moved on and this hasn’t seen recent activity, I’m going to close it for now. That’s a reflection of our delayed triage, not a lack of appreciation for your contribution. If the change is still relevant, please feel welcome to open a fresh pull request against the current codebase. Thank you again for contributing to RxJS and for your patience. — Ben |
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.