Repository navigation
Reduce port clashes in TestCluster - #6399
Conversation
|
I need to address some issues with this and perform some thread synchronization (yuck) |
4a9cc64 to
a385227
Compare
0b6deba to
aa95080
Compare
(cherry picked from commit fc1e0c4)
|
Why don't you just bind to port=0 and let OS guarantee you a free port? Present solution is full of race conditions and doesn't work reliably. |
|
The current solution uses in-memory transports and doesn't bind to ports during tests, by default. There is a reason why we also don't do what you're suggesting, though: the port is a part of the silos identity and it needs to know that before the bind occurs. Something different could work, but it would require significant changes. |
|
If tests are not binding to TCP ports, what's the point in TestClusterPortAllocator at all? |
|
Tests don't bind to TCP ports by default. We have some tests which use the TestCluster which spawn hosts in separate processes or test socket logic. Those tests do use TCP ports. |
This will not help as much on Linux, since named mutexes are only process-wide on Linux.
On Windows, this ought to work fairly well - we'll see 😅