integration: allow overwriting address generator
This commit is contained in:
parent
9250064837
commit
93cc7f36cf
1 changed files with 8 additions and 1 deletions
|
@ -58,6 +58,13 @@ var (
|
|||
|
||||
// Used to protest concurrent access to above declared variables.
|
||||
harnessStateMtx sync.RWMutex
|
||||
|
||||
// ListenAddressGenerator is a function that is used to generate two
|
||||
// listen addresses (host:port), one for the P2P listener and one for
|
||||
// the RPC listener. This is exported to allow overwriting of the
|
||||
// default behavior which isn't very concurrency safe (just selecting
|
||||
// a random port can produce collisions and therefore flakes).
|
||||
ListenAddressGenerator = generateListeningAddresses
|
||||
)
|
||||
|
||||
// HarnessTestCase represents a test-case which utilizes an instance of the
|
||||
|
@ -153,7 +160,7 @@ func New(activeNet *chaincfg.Params, handlers *rpcclient.NotificationHandlers,
|
|||
}
|
||||
|
||||
// Generate p2p+rpc listening addresses.
|
||||
config.listen, config.rpcListen = generateListeningAddresses()
|
||||
config.listen, config.rpcListen = ListenAddressGenerator()
|
||||
|
||||
// Create the testing node bounded to the simnet.
|
||||
node, err := newNode(config, nodeTestData)
|
||||
|
|
Loading…
Reference in a new issue