Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #168 from thanethomson/issues/increase-wait-for-ha…
Browse files Browse the repository at this point in the history
…rness

Update for new version of remote_val_harness
  • Loading branch information
liamsi authored Jan 25, 2019
2 parents a1c164d + 2d3f9db commit 84812b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ version: 2
jobs:
build:
docker:
- image: tendermint/kms:build-2019-01-24-v0 # bump cache keys when modifying this
- image: tendermint/kms:build-2019-01-25-v0 # bump cache keys when modifying this
steps:
- checkout
- restore_cache:
key: cache-2019-01-24-v0 # bump save_cache key below too
key: cache-2019-01-25-v0 # bump save_cache key below too
- run:
name: rustfmt
command: |
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
command: |
TMKMS_BIN=./target/debug/tmkms sh tests/support/run-harness-tests.sh
- save_cache:
key: cache-2019-01-24-v0 # bump restore_cache key above too
key: cache-2019-01-25-v0 # bump restore_cache key above too
paths:
- "~/.cargo"
- "./target"
16 changes: 12 additions & 4 deletions tests/support/run-harness-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ TMKMS_PID=$!

# Run the test harness in the foreground
${REMOTE_VAL_HARNESS_BIN} run \
--addr tcp://127.0.0.1:61278 \
--genesis-file ${TMHOME}/config/genesis.json \
--key-file ${TMHOME}/config/priv_validator_key.json \
--state-file ${TMHOME}/data/priv_validator_state.json
-addr tcp://127.0.0.1:61278 \
-tmhome ${TMHOME}
HARNESS_EXIT_CODE=$?

# Kill the KMS, if it's still running
if ps -p ${TMKMS_PID} > /dev/null
then
echo "Killing KMS (pid ${TMKMS_PID})"
kill ${TMKMS_PID}
# Wait a few seconds for KMS to die properly.
# NOTE: This also acts as a test of the KMS listening for and properly
# responding to the SIGTERM signal from `kill`.
sleep 3
# Make sure KMS has actually stopped properly now.
if ps -p ${TMKMS_PID} > /dev/null
then
echo "Failed to stop KMS!"
exit 100
fi
else
echo "KMS (pid ${TMKMS_PID}) already stopped, not killing"
fi
Expand Down

0 comments on commit 84812b2

Please sign in to comment.