bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
702 stars 147 forks source link

Timeout fires in test invalidating later tests #362

Closed ludlovian closed 5 years ago

ludlovian commented 5 years ago

In fixing #359, I noticed that some of the later tests failed randomly.

In an earlier test, a timeout is set to assert(fail) after 100ms to catch the situation where a DeviceDiscovery does not issue a timeout event when it should.

If the test passes, then the rogue timeout is left hanging to fire 100ms later, disrupting later tests.

https://github.com/bencevans/node-sonos/blob/851a5355cd014d794b3887ce74dee1cc3cacdef1/test/sonos.test.js#L314-L327

PR to fix on the way

svrooij commented 5 years ago

Next time if you type Fixes #362 in the commit, it will automatically close the issue when the PR is accepted.