From 3fd99a15220c2b114871df42831f360c85692f1d Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 19 Jun 2024 06:41:58 +0000 Subject: [PATCH] Handle race condition in laconic registry CLI tests (#843) Part of https://git.vdb.to/cerc-io/laconic-registry-cli/issues/63 Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/843 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- .gitea/workflows/triggers/fixturenet-laconicd-test | 1 + tests/fixturenet-laconicd/run-cli-test.sh | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/triggers/fixturenet-laconicd-test b/.gitea/workflows/triggers/fixturenet-laconicd-test index 10db7fd7..f377ae09 100644 --- a/.gitea/workflows/triggers/fixturenet-laconicd-test +++ b/.gitea/workflows/triggers/fixturenet-laconicd-test @@ -4,3 +4,4 @@ Trigger Trigger Trigger Trigger +Trigger diff --git a/tests/fixturenet-laconicd/run-cli-test.sh b/tests/fixturenet-laconicd/run-cli-test.sh index 8a5dcb42..28670390 100755 --- a/tests/fixturenet-laconicd/run-cli-test.sh +++ b/tests/fixturenet-laconicd/run-cli-test.sh @@ -22,16 +22,16 @@ echo "$(date +"%Y-%m-%d %T"): Stack started" # Verify that the fixturenet is up and running $TEST_TARGET_SO --stack fixturenet-laconicd deploy --cluster laconicd ps +# Wait for the laconid endpoint to come up +echo "Waiting for the RPC endpoint to come up" +docker exec laconicd-laconicd-1 sh -c "curl --retry 20 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api" + # Get the fixturenet account address laconicd_account_address=$(docker exec laconicd-laconicd-1 laconicd keys list | awk '/- address:/ {print $3}') # Copy over config docker exec laconicd-cli-1 cp config.yml laconic-registry-cli/ -# Wait for the laconid endpoint to come up -echo "Waiting for the RPC endpoint to come up" -docker exec laconicd-laconicd-1 sh -c "curl --retry 20 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api" - # Run the tests echo "Running the tests" docker exec -e TEST_ACCOUNT=$laconicd_account_address laconicd-cli-1 sh -c 'cd laconic-registry-cli && yarn && yarn test'