From 0cfc9d65fa00bb6102d8fed5ac56ad4951451ac0 Mon Sep 17 00:00:00 2001 From: Nathan Wilcox Date: Mon, 22 May 2017 17:46:13 -0700 Subject: [PATCH 1/4] Enable set -u mode. --- qa/zcash/performance-measurements.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qa/zcash/performance-measurements.sh b/qa/zcash/performance-measurements.sh index 7339609da..4b32ba146 100755 --- a/qa/zcash/performance-measurements.sh +++ b/qa/zcash/performance-measurements.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -u + DATADIR=./benchmark-datadir SHA256CMD="$(command -v sha256sum || echo shasum)" From 453c74743cacf3f42e557fd20e4aa505c15eb757 Mon Sep 17 00:00:00 2001 From: Nathan Wilcox Date: Mon, 22 May 2017 17:46:26 -0700 Subject: [PATCH 2/4] Fix a variable name typo. --- qa/zcash/performance-measurements.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/zcash/performance-measurements.sh b/qa/zcash/performance-measurements.sh index 4b32ba146..e01337169 100755 --- a/qa/zcash/performance-measurements.sh +++ b/qa/zcash/performance-measurements.sh @@ -34,7 +34,7 @@ function zcashd_start { function zcashd_stop { zcash_rpc stop > /dev/null - wait $ZCASH_PID + wait $ZCASHD_PID } function zcashd_massif_start { From 4e4769863375f32b9dbfbd3fbd1af016274dbcbb Mon Sep 17 00:00:00 2001 From: Nathan Wilcox Date: Mon, 22 May 2017 17:47:36 -0700 Subject: [PATCH 3/4] Reuse zcash_rpc. --- qa/zcash/performance-measurements.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/zcash/performance-measurements.sh b/qa/zcash/performance-measurements.sh index e01337169..ba6cc54f4 100755 --- a/qa/zcash/performance-measurements.sh +++ b/qa/zcash/performance-measurements.sh @@ -12,12 +12,12 @@ function zcash_rpc { function zcash_rpc_slow { # Timeout of 1 hour - ./src/zcash-cli -datadir="$DATADIR" -rpcwait -rpcuser=user -rpcpassword=password -rpcport=5983 -rpcclienttimeout=3600 "$@" + zcash_rpc -rpcclienttimeout=3600 "$@" } function zcash_rpc_veryslow { # Timeout of 2.5 hours - ./src/zcash-cli -datadir="$DATADIR" -rpcwait -rpcuser=user -rpcpassword=password -rpcport=5983 -rpcclienttimeout=9000 "$@" + zcash_rpc -rpcclienttimeout=9000 "$@" } function zcashd_generate { From 5a027a4a6e6e10bd41f992f85698abe8e3719fb4 Mon Sep 17 00:00:00 2001 From: Nathan Wilcox Date: Mon, 22 May 2017 17:51:23 -0700 Subject: [PATCH 4/4] Do not use `-rpcwait` on all `zcash_rpc` invocations, only block when starting zcashd. --- qa/zcash/performance-measurements.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qa/zcash/performance-measurements.sh b/qa/zcash/performance-measurements.sh index ba6cc54f4..e1eb242be 100755 --- a/qa/zcash/performance-measurements.sh +++ b/qa/zcash/performance-measurements.sh @@ -7,7 +7,7 @@ SHA256CMD="$(command -v sha256sum || echo shasum)" SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')" function zcash_rpc { - ./src/zcash-cli -datadir="$DATADIR" -rpcwait -rpcuser=user -rpcpassword=password -rpcport=5983 "$@" + ./src/zcash-cli -datadir="$DATADIR" -rpcuser=user -rpcpassword=password -rpcport=5983 "$@" } function zcash_rpc_slow { @@ -20,6 +20,10 @@ function zcash_rpc_veryslow { zcash_rpc -rpcclienttimeout=9000 "$@" } +function zcash_rpc_wait_for_start { + zcash_rpc -rpcwait getinfo > /dev/null +} + function zcashd_generate { zcash_rpc generate 101 > /dev/null } @@ -30,6 +34,7 @@ function zcashd_start { touch "$DATADIR/zcash.conf" ./src/zcashd -regtest -datadir="$DATADIR" -rpcuser=user -rpcpassword=password -rpcport=5983 -showmetrics=0 & ZCASHD_PID=$! + zcash_rpc_wait_for_start } function zcashd_stop { @@ -44,6 +49,7 @@ function zcashd_massif_start { rm -f massif.out valgrind --tool=massif --time-unit=ms --massif-out-file=massif.out ./src/zcashd -regtest -datadir="$DATADIR" -rpcuser=user -rpcpassword=password -rpcport=5983 -showmetrics=0 & ZCASHD_PID=$! + zcash_rpc_wait_for_start } function zcashd_massif_stop { @@ -59,6 +65,7 @@ function zcashd_valgrind_start { rm -f valgrind.out valgrind --leak-check=yes -v --error-limit=no --log-file="valgrind.out" ./src/zcashd -regtest -datadir="$DATADIR" -rpcuser=user -rpcpassword=password -rpcport=5983 -showmetrics=0 & ZCASHD_PID=$! + zcash_rpc_wait_for_start } function zcashd_valgrind_stop {