diff --git a/.github/workflows/no-caching-tests.yaml b/.github/workflows/no-caching-tests.yaml index a8fe3e0984..c6c5737124 100644 --- a/.github/workflows/no-caching-tests.yaml +++ b/.github/workflows/no-caching-tests.yaml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/reusable-tests.yaml with: cache: false - solana_cli_version: 2.3.0 + solana_cli_version: 2.3.13 node_version: 20.18.0 cargo_profile: release anchor_binary_name: anchor-binary-no-caching diff --git a/.github/workflows/reusable-tests.yaml b/.github/workflows/reusable-tests.yaml index 7b8af78491..4d7ff4e099 100644 --- a/.github/workflows/reusable-tests.yaml +++ b/.github/workflows/reusable-tests.yaml @@ -272,7 +272,7 @@ jobs: path: tests/bpf-upgradeable-state/target key: cargo-${{ runner.os }}-tests/bpf-upgradeable-state-${{ env.ANCHOR_VERSION }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }} - - run: solana-test-validator -r --quiet & + - run: ./launch-test-validator.sh name: start validator - run: cd tests/bpf-upgradeable-state && yarn --frozen-lockfile - run: cd tests/bpf-upgradeable-state diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ff4cf077b2..935ec6e042 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,7 +18,7 @@ jobs: uses: ./.github/workflows/reusable-tests.yaml with: cache: true - solana_cli_version: 2.3.0 + solana_cli_version: 2.3.13 node_version: 20.18.0 cargo_profile: debug anchor_binary_name: anchor-binary diff --git a/docker/Makefile b/docker/Makefile index cf6e5c6086..0ed19c0ff4 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,7 +1,7 @@ # Anchor version. ANCHOR_CLI=v0.32.1 # Solana toolchain. -SOLANA_CLI=v2.3.0 +SOLANA_CLI=v2.3.13 # Build version should match the Anchor cli version. VERSIONED_IMG_NAME=solanafoundation/anchor:$(ANCHOR_CLI) diff --git a/launch-test-validator.sh b/launch-test-validator.sh new file mode 100755 index 0000000000..57a6eb9aa9 --- /dev/null +++ b/launch-test-validator.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Launches the test validator in the background, waiting for it to be ready +# If the validator is not ready and healthy after 5 retries, exit with failure + +# set -o pipefail + +solana-test-validator -r --quiet 2>&1 >/dev/null & +curl http://localhost:8899 \ + --json '{"jsonrpc":"2.0","id":1, "method":"getHealth"}' \ + --retry-connrefused \ + --retry 5 \ + -s | grep '"ok"' >/dev/null + +if [ $? -eq 0 ]; then + exit 0 +else + echo "Validator didn't launch" >&2 + exit 1 +fi diff --git a/setup-tests.sh b/setup-tests.sh index b044113c00..e15959b984 100755 --- a/setup-tests.sh +++ b/setup-tests.sh @@ -1,8 +1,8 @@ #!/bin/bash active_version=$(solana -V | awk '{print $2}') -if [ "$active_version" != "2.3.0" ]; then - agave-install init 2.3.0 +if [ "$active_version" != "2.3.13" ]; then + agave-install init 2.3.13 fi git submodule update --init --recursive --depth 1