Open rossjones opened 8 months ago
Partial fix available in 54af2cf06 and 252e88afeac4ca0e0bb0941552a0dac72febe0f3
checking for ports is more of a workaround as it won't help against race conditions. It can be a quick fix, but we might need to look into proper way to initialize nats and capture initialization errors
If the NATS server attempts to start on a port, but that port is in use, an error is logged but processing does not stop.
In tests, if the port is in use from a previous test, then this results in authorization failures as the current test attempts to connect to the NATS from the previous test.
Currently we as nats to start with
go ns.Start()
, with no way of returning an error.Perhaps we might extend pkg/lib/network to check if specific ports are free. This will not be perfect but will catch the most obvious cases.