swifter
swifter copied to clipboard
fix(queue): moved socket iteration into queue
We have been experiencing issues with random test failure in Swifter's unit tests. Particularly testStopWithActiveConnections in IOSafetyTests
We believe this is due to stop() iterating through available sockets while they are potentially mutated by the global queue dispatch in start(). This PR moves the loop over sockets into the private queue to ensure that access is gated. It appears to fix our random failures with unit tests (so far 🤞)