From a1501dcde8af17ce299e8e4aadec4252f801ebea Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 26 Oct 2017 15:56:48 -0400 Subject: [PATCH 1/5] version bump --- CHANGELOG.md | 7 +++---- version/version.go | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4989ef67..0522b37ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,17 +34,16 @@ BREAKING CHANGES: - rpc/client: ABCIQuery no longer takes `prove` - state: remove GenesisDoc from state. - consensus: new binary WAL format provides efficiency and uses checksums to detect corruption - - see scripts/wal2json to convert to json for debugging + - use scripts/wal2json to convert to json for debugging FEATURES: - - new `certifiers` pkg contains the tendermint light-client library! + - new `certifiers` pkg contains the tendermint light-client library (name subject to change)! - rpc: `/genesis` includes the `app_options` . - rpc: `/abci_query` takes an additional `height` parameter to support historical queries. - rpc/client: new ABCIQueryWithOptions supports options like `trusted` (set false to get a proof`) and `height` to query a historical height. IMPROVEMENTS: - - genesis doc: added `app_options` field, which, along with the other fields, - will be returned upon `/genesis` rpc call. + - rpc: `/genesis` result includes `app_options` - rpc/lib/client: add jitter to reconnects. - rpc/lib/types: `RPCError` satisfies the `error` interface. diff --git a/version/version.go b/version/version.go index b874accc8..6995caa4c 100644 --- a/version/version.go +++ b/version/version.go @@ -1,12 +1,12 @@ package version const Maj = "0" -const Min = "11" -const Fix = "1" +const Min = "12" +const Fix = "0" var ( // The full version string - Version = "0.11.1" + Version = "0.12.0" // GitCommit is set with --ldflags "-X main.gitCommit=$(git rev-parse HEAD)" GitCommit string From b2b35d7dc10dd57d52130b6d0981c8fe1662537e Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 27 Oct 2017 11:53:39 -0400 Subject: [PATCH 2/5] update changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0522b37ed..1832ff812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ BUG FIXES: - Graceful handling/recovery for apps that have non-determinism or fail to halt - Graceful handling/recovery for violations of safety, or liveness -## 0.12.0 (TBD) +## 0.12.0 (October 27, 2017) BREAKING CHANGES: - rpc/client: websocket ResultsCh and ErrorsCh unified in ResponsesCh. @@ -40,7 +40,7 @@ FEATURES: - new `certifiers` pkg contains the tendermint light-client library (name subject to change)! - rpc: `/genesis` includes the `app_options` . - rpc: `/abci_query` takes an additional `height` parameter to support historical queries. - - rpc/client: new ABCIQueryWithOptions supports options like `trusted` (set false to get a proof`) and `height` to query a historical height. + - rpc/client: new ABCIQueryWithOptions supports options like `trusted` (set false to get a proof) and `height` to query a historical height. IMPROVEMENTS: - rpc: `/genesis` result includes `app_options` @@ -51,6 +51,7 @@ BUG FIXES: - rpc/client: fix ws deadlock after stopping - blockchain: fix panic on AddBlock when peer is nil - mempool: fix sending on TxsAvailable when a tx has been invalidated + - consensus: dont run WAL catchup if we fast synced ## 0.11.1 (October 10, 2017) From 21dcb4f2901a94c0817655a31c65e7a0a075c852 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 27 Oct 2017 13:55:56 -0400 Subject: [PATCH 3/5] update glide --- glide.lock | 14 +++++++------- glide.yaml | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/glide.lock b/glide.lock index ab3d5e856..63e71379e 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 58d209dee0c21d507226d6b56f7b7f49d24f60090ef9a6c1d89bc27ff00f90e4 -updated: 2017-10-26T00:04:10.142172009-04:00 +hash: 0b9134e3582541a31cf2e7b03cc610c66b100d0f9381c276bd3bd4ffeabc3baa +updated: 2017-10-27T13:55:42.192646567-04:00 imports: - name: github.com/btcsuite/btcd version: c7588cbf7690cd9f047a28efa2dcd8f2435a4e5e @@ -98,7 +98,7 @@ imports: - leveldb/table - leveldb/util - name: github.com/tendermint/abci - version: a0e38dc58374f485481ea07b23659d85f670a694 + version: dc33aad9b4e514a2322725ef68f27f72d955c537 subpackages: - client - example/counter @@ -111,18 +111,18 @@ imports: - edwards25519 - extra25519 - name: github.com/tendermint/go-crypto - version: 311e8c1bf00fa5868daad4f8ea56dcad539182c0 + version: d1f00be7a062bb90c6f66f268e5d5cc7ad8ad269 - name: github.com/tendermint/go-wire - version: 5f88da3dbc1a72844e6dfaf274ce87f851d488eb + version: 1019b2ded93cb6251c9836402b8ca358e18ce1bc subpackages: - data - data/base58 - name: github.com/tendermint/iavl - version: 595f3dcd5b6cd4a292e90757ae6d367fd7a6e653 + version: 594cc0c062a7174475f0ab654384038d77067917 subpackages: - iavl - name: github.com/tendermint/tmlibs - version: b30e3ba26d4077edeed83c50a4e0c38b0ec9ddb3 + version: d9525c0fb671204450b160807480e1263053fb20 subpackages: - autofile - cli diff --git a/glide.yaml b/glide.yaml index 82c2cd7b6..3751c75e2 100644 --- a/glide.yaml +++ b/glide.yaml @@ -18,23 +18,23 @@ import: - package: github.com/spf13/viper version: v1.0.0 - package: github.com/tendermint/abci - version: develop + version: ~0.7.0 subpackages: - client - example/dummy - types - package: github.com/tendermint/go-crypto - version: ~0.3.0 + version: ~0.4.0 - package: github.com/tendermint/go-wire - version: ~0.6.2 + version: ~0.7.0 subpackages: - data - package: github.com/tendermint/iavl - version: develop + version: ~0.2.0 subpackages: - iavl - package: github.com/tendermint/tmlibs - version: develop + version: ~0.4.0 subpackages: - autofile - cli From 4b616344fa63516dbaeafc3e74b24d8d7a5759e0 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 27 Oct 2017 22:36:03 -0400 Subject: [PATCH 4/5] update glide, again --- glide.lock | 18 +++++++++--------- glide.yaml | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/glide.lock b/glide.lock index 63e71379e..cd105b3c1 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,8 @@ -hash: 0b9134e3582541a31cf2e7b03cc610c66b100d0f9381c276bd3bd4ffeabc3baa -updated: 2017-10-27T13:55:42.192646567-04:00 +hash: 0f9ba99fd411afaaf90993037b0067c5f9f873554f407a6ae9afa0e2548343c5 +updated: 2017-10-27T22:34:38.187149434-04:00 imports: - name: github.com/btcsuite/btcd - version: c7588cbf7690cd9f047a28efa2dcd8f2435a4e5e + version: 8cea3866d0f7fb12d567a20744942c0d078c7d15 subpackages: - btcec - name: github.com/ebuchman/fail-test @@ -10,7 +10,7 @@ imports: - name: github.com/fsnotify/fsnotify version: 4da3e2cfbabc9f751898f250b49f2439785783a1 - name: github.com/go-kit/kit - version: 4dc7be5d2d12881735283bcab7352178e190fc71 + version: e2b298466b32c7cd5579a9b9b07e968fc9d9452c subpackages: - log - log/level @@ -106,14 +106,14 @@ imports: - server - types - name: github.com/tendermint/ed25519 - version: 1f52c6f8b8a5c7908aff4497c186af344b428925 + version: d8387025d2b9d158cf4efb07e7ebf814bcce2057 subpackages: - edwards25519 - extra25519 - name: github.com/tendermint/go-crypto - version: d1f00be7a062bb90c6f66f268e5d5cc7ad8ad269 + version: dd20358a264c772b4a83e477b0cfce4c88a7001d - name: github.com/tendermint/go-wire - version: 1019b2ded93cb6251c9836402b8ca358e18ce1bc + version: 2baffcb6b690057568bc90ef1d457efb150b979a subpackages: - data - data/base58 @@ -147,7 +147,7 @@ imports: - ripemd160 - salsa20/salsa - name: golang.org/x/net - version: 4b14673ba32bee7f5ac0f990a48f033919fd418b + version: c73622c77280266305273cb545f54516ced95b93 subpackages: - context - http2 @@ -157,7 +157,7 @@ imports: - lex/httplex - trace - name: golang.org/x/sys - version: 176de7413414c01569163271c745672ff04a7267 + version: b98136db334ff9cb24f28a68e3be3cb6608f7630 subpackages: - unix - name: golang.org/x/text diff --git a/glide.yaml b/glide.yaml index 3751c75e2..4c1f7e21f 100644 --- a/glide.yaml +++ b/glide.yaml @@ -24,9 +24,9 @@ import: - example/dummy - types - package: github.com/tendermint/go-crypto - version: ~0.4.0 + version: ~0.4.1 - package: github.com/tendermint/go-wire - version: ~0.7.0 + version: ~0.7.1 subpackages: - data - package: github.com/tendermint/iavl From dfe28c8855bd6d55ca6713ffc2ba06ae9d731062 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 27 Oct 2017 23:09:50 -0400 Subject: [PATCH 5/5] test: update for abci-cli consolidation. shell formatting --- test/app/clean.sh | 3 +- test/app/dummy_test.sh | 26 ++-- test/app/test.sh | 188 +++++++++++++-------------- test/persist/test_failure_indices.sh | 182 +++++++++++++------------- test/persist/test_simple.sh | 54 ++++---- test/run_test.sh | 8 +- 6 files changed, 230 insertions(+), 231 deletions(-) diff --git a/test/app/clean.sh b/test/app/clean.sh index 8c5562239..22814f015 100644 --- a/test/app/clean.sh +++ b/test/app/clean.sh @@ -1,4 +1,3 @@ killall tendermint -killall dummy -killall counter +killall abci-cli rm -rf ~/.tendermint_app diff --git a/test/app/dummy_test.sh b/test/app/dummy_test.sh index 1a117c634..b3db0b86b 100644 --- a/test/app/dummy_test.sh +++ b/test/app/dummy_test.sh @@ -2,7 +2,7 @@ set -e function toHex() { - echo -n $1 | hexdump -ve '1/1 "%.2X"' | awk '{print "0x" $0}' + echo -n $1 | hexdump -ve '1/1 "%.2X"' | awk '{print "0x" $0}' } @@ -32,9 +32,9 @@ RESPONSE=`abci-cli query \"$KEY\"` set +e A=`echo $RESPONSE | grep "$VALUE"` if [[ $? != 0 ]]; then - echo "Failed to find $VALUE for $KEY. Response:" - echo "$RESPONSE" - exit 1 + echo "Failed to find $VALUE for $KEY. Response:" + echo "$RESPONSE" + exit 1 fi set -e @@ -43,9 +43,9 @@ RESPONSE=`abci-cli query \"$VALUE\"` set +e A=`echo $RESPONSE | grep $VALUE` if [[ $? == 0 ]]; then - echo "Found '$VALUE' for $VALUE when we should not have. Response:" - echo "$RESPONSE" - exit 1 + echo "Found '$VALUE' for $VALUE when we should not have. Response:" + echo "$RESPONSE" + exit 1 fi set -e @@ -62,9 +62,9 @@ RESPONSE=`echo $RESPONSE | jq .result.response.log` set +e A=`echo $RESPONSE | grep 'exists'` if [[ $? != 0 ]]; then - echo "Failed to find 'exists' for $KEY. Response:" - echo "$RESPONSE" - exit 1 + echo "Failed to find 'exists' for $KEY. Response:" + echo "$RESPONSE" + exit 1 fi set -e @@ -74,9 +74,9 @@ RESPONSE=`echo $RESPONSE | jq .result.response.log` set +e A=`echo $RESPONSE | grep 'exists'` if [[ $? == 0 ]]; then - echo "Found 'exists' for $VALUE when we should not have. Response:" - echo "$RESPONSE" - exit 1 + echo "Found 'exists' for $VALUE when we should not have. Response:" + echo "$RESPONSE" + exit 1 fi set -e diff --git a/test/app/test.sh b/test/app/test.sh index cd312b68a..355fab45e 100644 --- a/test/app/test.sh +++ b/test/app/test.sh @@ -11,118 +11,118 @@ set -e export TMHOME=$HOME/.tendermint_app function dummy_over_socket(){ - rm -rf $TMHOME - tendermint init - echo "Starting dummy_over_socket" - dummy > /dev/null & - pid_dummy=$! - tendermint node > tendermint.log & - pid_tendermint=$! - sleep 5 - - echo "running test" - bash dummy_test.sh "Dummy over Socket" - - kill -9 $pid_dummy $pid_tendermint + rm -rf $TMHOME + tendermint init + echo "Starting dummy_over_socket" + abci-cli dummy > /dev/null & + pid_dummy=$! + tendermint node > tendermint.log & + pid_tendermint=$! + sleep 5 + + echo "running test" + bash dummy_test.sh "Dummy over Socket" + + kill -9 $pid_dummy $pid_tendermint } # start tendermint first function dummy_over_socket_reorder(){ - rm -rf $TMHOME - tendermint init - echo "Starting dummy_over_socket_reorder (ie. start tendermint first)" - tendermint node > tendermint.log & - pid_tendermint=$! - sleep 2 - dummy > /dev/null & - pid_dummy=$! - sleep 5 - - echo "running test" - bash dummy_test.sh "Dummy over Socket" - - kill -9 $pid_dummy $pid_tendermint + rm -rf $TMHOME + tendermint init + echo "Starting dummy_over_socket_reorder (ie. start tendermint first)" + tendermint node > tendermint.log & + pid_tendermint=$! + sleep 2 + abci-cli dummy > /dev/null & + pid_dummy=$! + sleep 5 + + echo "running test" + bash dummy_test.sh "Dummy over Socket" + + kill -9 $pid_dummy $pid_tendermint } function counter_over_socket() { - rm -rf $TMHOME - tendermint init - echo "Starting counter_over_socket" - counter --serial > /dev/null & - pid_counter=$! - tendermint node > tendermint.log & - pid_tendermint=$! - sleep 5 - - echo "running test" - bash counter_test.sh "Counter over Socket" - - kill -9 $pid_counter $pid_tendermint + rm -rf $TMHOME + tendermint init + echo "Starting counter_over_socket" + abci-cli counter --serial > /dev/null & + pid_counter=$! + tendermint node > tendermint.log & + pid_tendermint=$! + sleep 5 + + echo "running test" + bash counter_test.sh "Counter over Socket" + + kill -9 $pid_counter $pid_tendermint } function counter_over_grpc() { - rm -rf $TMHOME - tendermint init - echo "Starting counter_over_grpc" - counter --serial --abci grpc > /dev/null & - pid_counter=$! - tendermint node --abci grpc > tendermint.log & - pid_tendermint=$! - sleep 5 - - echo "running test" - bash counter_test.sh "Counter over GRPC" - - kill -9 $pid_counter $pid_tendermint + rm -rf $TMHOME + tendermint init + echo "Starting counter_over_grpc" + abci-cli counter --serial --abci grpc > /dev/null & + pid_counter=$! + tendermint node --abci grpc > tendermint.log & + pid_tendermint=$! + sleep 5 + + echo "running test" + bash counter_test.sh "Counter over GRPC" + + kill -9 $pid_counter $pid_tendermint } function counter_over_grpc_grpc() { - rm -rf $TMHOME - tendermint init - echo "Starting counter_over_grpc_grpc (ie. with grpc broadcast_tx)" - counter --serial --abci grpc > /dev/null & - pid_counter=$! - sleep 1 - GRPC_PORT=36656 - tendermint node --abci grpc --rpc.grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log & - pid_tendermint=$! - sleep 5 - - echo "running test" - GRPC_BROADCAST_TX=true bash counter_test.sh "Counter over GRPC via GRPC BroadcastTx" - - kill -9 $pid_counter $pid_tendermint + rm -rf $TMHOME + tendermint init + echo "Starting counter_over_grpc_grpc (ie. with grpc broadcast_tx)" + abci-cli counter --serial --abci grpc > /dev/null & + pid_counter=$! + sleep 1 + GRPC_PORT=36656 + tendermint node --abci grpc --rpc.grpc_laddr tcp://localhost:$GRPC_PORT > tendermint.log & + pid_tendermint=$! + sleep 5 + + echo "running test" + GRPC_BROADCAST_TX=true bash counter_test.sh "Counter over GRPC via GRPC BroadcastTx" + + kill -9 $pid_counter $pid_tendermint } cd $GOPATH/src/github.com/tendermint/tendermint/test/app case "$1" in - "dummy_over_socket") - dummy_over_socket - ;; - "dummy_over_socket_reorder") - dummy_over_socket_reorder - ;; - "counter_over_socket") - counter_over_socket - ;; - "counter_over_grpc") - counter_over_grpc - ;; - "counter_over_grpc_grpc") - counter_over_grpc_grpc - ;; - *) - echo "Running all" - dummy_over_socket - echo "" - dummy_over_socket_reorder - echo "" - counter_over_socket - echo "" - counter_over_grpc - echo "" - counter_over_grpc_grpc + "dummy_over_socket") + dummy_over_socket + ;; +"dummy_over_socket_reorder") + dummy_over_socket_reorder + ;; + "counter_over_socket") + counter_over_socket + ;; +"counter_over_grpc") + counter_over_grpc + ;; + "counter_over_grpc_grpc") + counter_over_grpc_grpc + ;; +*) + echo "Running all" + dummy_over_socket + echo "" + dummy_over_socket_reorder + echo "" + counter_over_socket + echo "" + counter_over_grpc + echo "" + counter_over_grpc_grpc esac diff --git a/test/persist/test_failure_indices.sh b/test/persist/test_failure_indices.sh index 41c17a094..6c40786d9 100644 --- a/test/persist/test_failure_indices.sh +++ b/test/persist/test_failure_indices.sh @@ -9,66 +9,66 @@ tendermint init RPC_ADDR="$(pwd)/rpc.sock" TM_CMD="tendermint node --log_level=debug --rpc.laddr=unix://$RPC_ADDR" # &> tendermint_${name}.log" -DUMMY_CMD="dummy --persist $TMHOME/dummy" # &> dummy_${name}.log" +DUMMY_CMD="abci-cli dummy --persist $TMHOME/dummy" # &> dummy_${name}.log" function start_procs(){ - name=$1 - indexToFail=$2 - echo "Starting persistent dummy and tendermint" - if [[ "$CIRCLECI" == true ]]; then - $DUMMY_CMD & - else - $DUMMY_CMD &> "dummy_${name}.log" & - fi - PID_DUMMY=$! - - # before starting tendermint, remove the rpc socket - rm $RPC_ADDR - if [[ "$indexToFail" == "" ]]; then - # run in background, dont fail - if [[ "$CIRCLECI" == true ]]; then - $TM_CMD & - else - $TM_CMD &> "tendermint_${name}.log" & - fi - PID_TENDERMINT=$! - else - # run in foreground, fail - if [[ "$CIRCLECI" == true ]]; then - FAIL_TEST_INDEX=$indexToFail $TM_CMD - else - FAIL_TEST_INDEX=$indexToFail $TM_CMD &> "tendermint_${name}.log" - fi - PID_TENDERMINT=$! - fi + name=$1 + indexToFail=$2 + echo "Starting persistent dummy and tendermint" + if [[ "$CIRCLECI" == true ]]; then + $DUMMY_CMD & + else + $DUMMY_CMD &> "dummy_${name}.log" & + fi + PID_DUMMY=$! + + # before starting tendermint, remove the rpc socket + rm $RPC_ADDR + if [[ "$indexToFail" == "" ]]; then + # run in background, dont fail + if [[ "$CIRCLECI" == true ]]; then + $TM_CMD & + else + $TM_CMD &> "tendermint_${name}.log" & + fi + PID_TENDERMINT=$! + else + # run in foreground, fail + if [[ "$CIRCLECI" == true ]]; then + FAIL_TEST_INDEX=$indexToFail $TM_CMD + else + FAIL_TEST_INDEX=$indexToFail $TM_CMD &> "tendermint_${name}.log" + fi + PID_TENDERMINT=$! + fi } function kill_procs(){ - kill -9 "$PID_DUMMY" "$PID_TENDERMINT" - wait "$PID_DUMMY" - wait "$PID_TENDERMINT" + kill -9 "$PID_DUMMY" "$PID_TENDERMINT" + wait "$PID_DUMMY" + wait "$PID_TENDERMINT" } # wait for port to be available function wait_for_port() { - port=$1 - # this will succeed while port is bound - nc -z 127.0.0.1 $port - ERR=$? - i=0 - while [ "$ERR" == 0 ]; do - echo "... port $port is still bound. waiting ..." - sleep 1 - nc -z 127.0.0.1 $port - ERR=$? - i=$((i + 1)) - if [[ $i == 10 ]]; then - echo "Timed out waiting for port to be released" - exit 1 - fi - done - echo "... port $port is free!" + port=$1 + # this will succeed while port is bound + nc -z 127.0.0.1 $port + ERR=$? + i=0 + while [ "$ERR" == 0 ]; do + echo "... port $port is still bound. waiting ..." + sleep 1 + nc -z 127.0.0.1 $port + ERR=$? + i=$((i + 1)) + if [[ $i == 10 ]]; then + echo "Timed out waiting for port to be released" + exit 1 + fi + done + echo "... port $port is free!" } @@ -77,47 +77,47 @@ fails=$(grep -r "fail.Fail" --include \*.go . | wc -l) failsEnd=$((fails-1)) for failIndex in $(seq $failsStart $failsEnd); do - echo "" - echo "* Test FailIndex $failIndex" - # test failure at failIndex - - bash ./test/utils/txs.sh "localhost:46657" & - start_procs 1 "$failIndex" - - # tendermint should already have exited when it hits the fail index - # but kill -9 for good measure - kill_procs - - start_procs 2 - - # wait for node to handshake and make a new block - # NOTE: --unix-socket is only available in curl v7.40+ - curl -s --unix-socket "$RPC_ADDR" http://localhost/status > /dev/null - ERR=$? - i=0 - while [ "$ERR" != 0 ]; do - sleep 1 - curl -s --unix-socket "$RPC_ADDR" http://localhost/status > /dev/null - ERR=$? - i=$((i + 1)) - if [[ $i == 20 ]]; then - echo "Timed out waiting for tendermint to start" - exit 1 - fi - done - - # wait for a new block - h1=$(curl -s --unix-socket "$RPC_ADDR" http://localhost/status | jq .result.latest_block_height) - h2=$h1 - while [ "$h2" == "$h1" ]; do - sleep 1 - h2=$(curl -s --unix-socket "$RPC_ADDR" http://localhost/status | jq .result.latest_block_height) - done - - kill_procs - - echo "* Passed Test for FailIndex $failIndex" - echo "" + echo "" + echo "* Test FailIndex $failIndex" + # test failure at failIndex + + bash ./test/utils/txs.sh "localhost:46657" & + start_procs 1 "$failIndex" + + # tendermint should already have exited when it hits the fail index + # but kill -9 for good measure + kill_procs + + start_procs 2 + + # wait for node to handshake and make a new block + # NOTE: --unix-socket is only available in curl v7.40+ + curl -s --unix-socket "$RPC_ADDR" http://localhost/status > /dev/null + ERR=$? + i=0 + while [ "$ERR" != 0 ]; do + sleep 1 + curl -s --unix-socket "$RPC_ADDR" http://localhost/status > /dev/null + ERR=$? + i=$((i + 1)) + if [[ $i == 20 ]]; then + echo "Timed out waiting for tendermint to start" + exit 1 + fi + done + + # wait for a new block + h1=$(curl -s --unix-socket "$RPC_ADDR" http://localhost/status | jq .result.latest_block_height) + h2=$h1 + while [ "$h2" == "$h1" ]; do + sleep 1 + h2=$(curl -s --unix-socket "$RPC_ADDR" http://localhost/status | jq .result.latest_block_height) + done + + kill_procs + + echo "* Passed Test for FailIndex $failIndex" + echo "" done echo "Passed Test: Persistence" diff --git a/test/persist/test_simple.sh b/test/persist/test_simple.sh index 273c714ca..964862c44 100644 --- a/test/persist/test_simple.sh +++ b/test/persist/test_simple.sh @@ -7,30 +7,30 @@ rm -rf $TMHOME tendermint init function start_procs(){ - name=$1 - echo "Starting persistent dummy and tendermint" - dummy --persist $TMHOME/dummy &> "dummy_${name}.log" & - PID_DUMMY=$! - tendermint node &> tendermint_${name}.log & - PID_TENDERMINT=$! - sleep 5 + name=$1 + echo "Starting persistent dummy and tendermint" + abci-cli dummy --persist $TMHOME/dummy &> "dummy_${name}.log" & + PID_DUMMY=$! + tendermint node &> tendermint_${name}.log & + PID_TENDERMINT=$! + sleep 5 } function kill_procs(){ - kill -9 $PID_DUMMY $PID_TENDERMINT + kill -9 $PID_DUMMY $PID_TENDERMINT } function send_txs(){ - # send a bunch of txs over a few blocks - echo "Sending txs" - for i in `seq 1 5`; do - for j in `seq 1 100`; do - tx=`head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"'` - curl -s 127.0.0.1:46657/broadcast_tx_async?tx=0x$tx &> /dev/null - done - sleep 1 - done + # send a bunch of txs over a few blocks + echo "Sending txs" + for i in `seq 1 5`; do + for j in `seq 1 100`; do + tx=`head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"'` + curl -s 127.0.0.1:46657/broadcast_tx_async?tx=0x$tx &> /dev/null + done + sleep 1 + done } @@ -46,22 +46,22 @@ curl -s $addr/status > /dev/null ERR=$? i=0 while [ "$ERR" != 0 ]; do - sleep 1 - curl -s $addr/status > /dev/null - ERR=$? - i=$(($i + 1)) - if [[ $i == 10 ]]; then - echo "Timed out waiting for tendermint to start" - exit 1 - fi + sleep 1 + curl -s $addr/status > /dev/null + ERR=$? + i=$(($i + 1)) + if [[ $i == 10 ]]; then + echo "Timed out waiting for tendermint to start" + exit 1 + fi done # wait for a new block h1=`curl -s $addr/status | jq .result.latest_block_height` h2=$h1 while [ "$h2" == "$h1" ]; do - sleep 1 - h2=`curl -s $addr/status | jq .result.latest_block_height` + sleep 1 + h2=`curl -s $addr/status | jq .result.latest_block_height` done kill_procs diff --git a/test/run_test.sh b/test/run_test.sh index b505126ea..6e4823f10 100644 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -16,8 +16,8 @@ bash test/app/test.sh bash test/persist/test.sh if [[ "$BRANCH" == "master" || $(echo "$BRANCH" | grep "release-") != "" ]]; then - echo "" - echo "* branch $BRANCH; testing libs" - # checkout every github.com/tendermint dir and run its tests - bash test/test_libs.sh + echo "" + echo "* branch $BRANCH; testing libs" + # checkout every github.com/tendermint dir and run its tests + bash test/test_libs.sh fi