pyln-testing: replace ephemeral-port-reserve with a filesystem lock approach#9211
pyln-testing: replace ephemeral-port-reserve with a filesystem lock approach#9211daywalker90 wants to merge 1 commit into
Conversation
…pproach using pytest-xdist the ephemeral-port-reserve approach would only ensure no port conflicts per pytest worker. There could still be race conditions where we get "address already in use". This new filesystem approach should work across pytest workers Changelog-None
|
I don't quite get why it is necessary to keep a list of reserved ports at all. The idea is to have the OS itself track the reservations, and have them time out after the usual 30s - 60s cleanup timeout, after which the So unless we have a test that somehow assumes we have control over a port, while not actively bound to it, for prolonged periods (30s - 60s+) we should never need to materialize the list of reservations, even worse, the list of reservations may think it has control over a port, when the OS has already given that port to someone else. So the materialized port list may actually be causing collisions that are harder to debug. To me, a test that runs for longer than 30s and still expects to have exclusive control over a port is the bigger problem. Due to the port returning to the free-pool, and the OS being allowed to reassign it, the list reservation approach will never work I think. |
using pytest-xdist the ephemeral-port-reserve approach would only ensure no port conflicts per pytest worker. There could still be race conditions where we get "address already in use".
This new filesystem approach should work across pytest workers
Changelog-None