From da04616fd41ee63e9602244e48e7c74eb19320ab Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2020 05:54:08 +0000 Subject: [PATCH] Fix race in ci/run-sanity.sh (#10796) (#10801) (cherry picked from commit 4dc9f378b884f3716b5c7cf1eb577c425befc479) Co-authored-by: Ryo Onodera --- ci/run-sanity.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci/run-sanity.sh b/ci/run-sanity.sh index d113f95615..54cf44a501 100755 --- a/ci/run-sanity.sh +++ b/ci/run-sanity.sh @@ -19,13 +19,16 @@ while [[ ! -f config/run/init-completed ]]; do fi done -while [[ $($solana_cli --url http://localhost:8899 slot --commitment recent) -eq 0 ]]; do +snapshot_slot=1 + +# wait a bit longer than snapshot_slot +while [[ $($solana_cli --url http://localhost:8899 slot --commitment recent) -le $((snapshot_slot + 1)) ]]; do sleep 1 done curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1, "method":"validatorExit"}' http://localhost:8899 wait $pid -$solana_ledger_tool create-snapshot --ledger config/ledger 1 config/snapshot-ledger +$solana_ledger_tool create-snapshot --ledger config/ledger "$snapshot_slot" config/snapshot-ledger cp config/ledger/genesis.tar.bz2 config/snapshot-ledger $solana_ledger_tool verify --ledger config/snapshot-ledger