itest+lntest: use system wide unique ports everywhere
With this commit we create a new function that returns system wide unique ports by using a single file to keep track of previously used ports. We'll want to use this everywhere whenever we need to listen on a new, random port during unit or integration tests. Because we now have a unique source, we don't need to apply the port offset that was used for the different tranches of parallel running integration tests before.
This commit is contained in:
8 files changed
+184
-74
No files matched your search
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lnrpc/wtclientrpc"
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
"github.com/lightningnetwork/lnd/lntest/node"
|
||||
"github.com/lightningnetwork/lnd/lntest/port"
|
||||
"github.com/lightningnetwork/lnd/lntest/rpc"
|
||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -595,7 +596,7 @@ func testRevokedCloseRetributionAltruistWatchtowerCase(ht *lntest.HarnessTest,
|
||||
func setUpNewTower(ht *lntest.HarnessTest, name, externalIP string) ([]byte,
|
||||
string, *rpc.HarnessRPC) {
|
||||
|
||||
port := node.NextAvailablePort()
|
||||
port := port.NextAvailablePort()
|
||||
|
||||
listenAddr := fmt.Sprintf("0.0.0.0:%d", port)
|
||||
|
||||
|
||||
Reference in new issue
Block a user