Skip to content

Commit

Permalink
Bind hydra-node to 0.0.0.0 in hydra-cluster tests
Browse files Browse the repository at this point in the history
This will make tests fail more obvious with an error:
```
Process "hydra-node (1)" exited with failure code: 1
       Process stderr: RunServerException {ioException = Network.Socket.bind: resource busy (Address already in use), host = 0.0.0.0, port = 4001}
```

Instead of silently providing data from a different hydra-node instance.
  • Loading branch information
ch1bo committed Apr 16, 2024
1 parent 7eeeadb commit d525ffc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hydra-cluster/src/HydraNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,16 @@ withHydraNode' tracer chainConfig workDir hydraNodeId hydraSKey hydraVKeys allNo
filepath <$ writeFileTextEnvelope (File filepath) Nothing vKey
let p =
( hydraNodeProcess $
-- NOTE: Using 0.0.0.0 over 127.0.0.1 will make the hydra-node
-- crash if it can't bind the interface and make tests fail more
-- obvious when e.g. a hydra-node instance is already running.
RunOptions
{ verbosity = Verbose "HydraNode"
, nodeId = NodeId $ show hydraNodeId
, host = "127.0.0.1"
, host = "0.0.0.0"
, port = fromIntegral $ 5_000 + hydraNodeId
, peers
, apiHost = "127.0.0.1"
, apiHost = "0.0.0.0"
, apiPort = fromIntegral $ 4_000 + hydraNodeId
, monitoringPort = Just $ fromIntegral $ 6_000 + hydraNodeId
, hydraSigningKey
Expand Down

0 comments on commit d525ffc

Please sign in to comment.