I still believe fake-timers are the main issue behind this. There are still some other tests being flaky due to fake timers tickAsync. I opened a pull request to discuss a potential solution.
Steps I've taken:
Understand multiple tests were contradicting each other due to the same port number
Run the test couple of times, it was still flaky
Updated sinon fake timers and tap, since the only ambigious side of the test was the fake timers.
I still believe fake-timers are the main issue behind this. There are still some other tests being flaky due to fake timers tickAsync. I opened a pull request to discuss a potential solution.
Steps I've taken: