Skip to content

Commit 13377b7

Browse files
author
MarcoFalke
committed
Merge #16918: test: Make PORT_MIN in test runner configurable
fa69588 test: Make PORT_MIN in test runner configurable (MarcoFalke) Pull request description: This is needed when some ports in the port range are used by other processes. Note that simply assigning the ports dynamically does not work: * We spin up several nodes per test (each node gets its own port) * We run several tests in parallel So to avoid nodes from different tests colliding on ports, the port assignment must be deterministic (can not be dynamic). Fixes: #10869 ACKs for top commit: practicalswift: ACK fa69588 -- diff looks correct promag: ACK fa69588. Tree-SHA512: e79adb015e7de79064e2d14336c38bc9672bd779ad6c52917721897e73f617c39d32c068a369c26670002a6c4ab95a71ef3a6878ebdd9710e02f410e2f7bcd14
2 parents cf57e33 + fa69588 commit 13377b7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.cirrus.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ task:
99
MAKEJOBS: "-j9"
1010
CONFIGURE_OPTS: "--disable-dependency-tracking"
1111
GOAL: "install"
12+
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
1213
CCACHE_SIZE: "200M"
1314
CCACHE_COMPRESS: 1
1415
CCACHE_DIR: "/tmp/ccache_dir"
@@ -37,6 +38,7 @@ task:
3738
env:
3839
MAKEJOBS: "-j9"
3940
RUN_CI_ON_HOST: "1"
41+
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
4042
CCACHE_SIZE: "200M"
4143
CCACHE_DIR: "/tmp/ccache_dir"
4244
ccache_cache:

test/functional/test_framework/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
from base64 import b64encode
88
from binascii import unhexlify
99
from decimal import Decimal, ROUND_DOWN
10+
from subprocess import CalledProcessError
1011
import inspect
1112
import json
1213
import logging
1314
import os
1415
import random
1516
import re
16-
from subprocess import CalledProcessError
1717
import time
1818

1919
from . import coverage
@@ -235,10 +235,11 @@ def wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=N
235235
# The maximum number of nodes a single test can spawn
236236
MAX_NODES = 12
237237
# Don't assign rpc or p2p ports lower than this
238-
PORT_MIN = 11000
238+
PORT_MIN = int(os.getenv('TEST_RUNNER_PORT_MIN', default=11000))
239239
# The number of ports to "reserve" for p2p and rpc, each
240240
PORT_RANGE = 5000
241241

242+
242243
class PortSeed:
243244
# Must be initialized with a unique integer for each process
244245
n = None

0 commit comments

Comments
 (0)