mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 14:54:26 +01:00
test: allow three variants in parallel with parallel make.
This means running 3 bitcoinds, which is slow enough to start on my laptop that I need to increase the startup wait for 30 to 60 seconds, and similarly the test.sh check loop. Before: real 13m42.868s After: real 8m19.563s (make -j3) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -15,7 +15,7 @@ rm -rf $DATADIR
|
||||
mkdir $DATADIR
|
||||
|
||||
# Find a free port (racy, but hey)
|
||||
PORT=`findport 18332`
|
||||
PORT=`findport 18332 $VARIANT`
|
||||
RPCPORT=`findport $(($PORT + 1))`
|
||||
|
||||
# Create appropriate config file so cmdline matches.
|
||||
@@ -29,7 +29,7 @@ EOF
|
||||
$DAEMON &
|
||||
i=0
|
||||
while ! $CLI getinfo >/dev/null 2>&1; do
|
||||
if [ $i -gt 30 ]; then
|
||||
if [ $i -gt 60 ]; then
|
||||
echo $DAEMON start failed? >&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if which eatmydata >/dev/null; then EATMYDATA=eatmydata; fi
|
||||
|
||||
STYLE=bitcoin
|
||||
DATADIR=/tmp/bitcoin-lightning
|
||||
DATADIR=/tmp/bitcoin-lightning$VARIANT
|
||||
CLI="bitcoin-cli -datadir=$DATADIR"
|
||||
REGTESTDIR=regtest
|
||||
DAEMON="$EATMYDATA bitcoind -datadir=$DATADIR"
|
||||
@@ -12,6 +12,8 @@ DAEMON="$EATMYDATA bitcoind -datadir=$DATADIR"
|
||||
findport()
|
||||
{
|
||||
PORT=$1
|
||||
# Give two ports per variant.
|
||||
if [ x"$2" != x ]; then PORT=$(($PORT + $2 * 2)); fi
|
||||
while netstat -ntl | grep -q ":$PORT "; do PORT=$(($PORT + 1)); done
|
||||
echo $PORT
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user