From 75608446bc075a388cad607021492fcc2d9c0375 Mon Sep 17 00:00:00 2001 From: Radu Matei Date: Sat, 5 Mar 2022 17:11:51 +0200 Subject: [PATCH] fix(tests): fix wrong timeout in integration test This commit fixes a wrong timeout in the integration test logic that added a 120-second sleep cycle for tests when a particular server (Bindle or Spin) wasn't ready, as opposed to waiting for one second, for a total of 120 times when needed. This commit also temporarily removes the unused release CI workflow altogether. Signed-off-by: Radu Matei --- .github/workflows/release.yml | 160 ---------------------------------- tests/integration.rs | 4 +- 2 files changed, 2 insertions(+), 162 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d4408309..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,160 +0,0 @@ -# TODO -# -# Temporarily disabling this workflow since macOS workers consume 10x as many -# CI minutes as Linux workers, which made us consume the included minutes for this -# month. -# -# Once the project is public, we can just uncomment this and re-add this workflow. - -# name: Release -# on: -# push: -# branches: -# - main -# tags: -# - "v*" - -# jobs: -# build: -# name: build release assets -# runs-on: ${{ matrix.config.os }} -# env: ${{ matrix.config.env }} -# strategy: -# matrix: -# config: -# - { -# os: "ubuntu-latest", -# arch: "amd64", -# extension: "", -# extraArgs: "", -# target: "", -# targetDir: "target/release", -# env: {}, -# } -# - { -# os: "ubuntu-latest", -# arch: "aarch64", -# extension: "", -# extraArgs: "--target aarch64-unknown-linux-gnu", -# target: "aarch64-unknown-linux-gnu", -# targetDir: "target/aarch64-unknown-linux-gnu/release", -# env: { OPENSSL_DIR: "/usr/local/openssl-aarch64" }, -# } -# - { -# os: "macos-latest", -# arch: "amd64", -# extension: "", -# extraArgs: "", -# target: "", -# targetDir: "target/release", -# env: {}, -# } -# - { -# os: "macos-latest", -# arch: "aarch64", -# extension: "", -# extraArgs: "--target aarch64-apple-darwin", -# target: "aarch64-apple-darwin", -# targetDir: "target/aarch64-apple-darwin/release/", -# env: { OPENSSL_DIR: "/usr/local/openssl-aarch64" }, -# } -# - { -# os: "windows-latest", -# arch: "amd64", -# extension: ".exe", -# extraArgs: "", -# target: "", -# targetDir: "target/release", -# env: {}, -# } -# steps: -# - uses: actions/checkout@v2 - -# - name: set the release version (tag) -# if: startsWith(github.ref, 'refs/tags/v') -# shell: bash -# run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - -# - name: set the release version (main) -# if: github.ref == 'refs/heads/main' -# shell: bash -# run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV - -# - name: lowercase the runner OS name -# shell: bash -# run: | -# OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]') -# echo "RUNNER_OS=$OS" >> $GITHUB_ENV - -# - name: "Install Wasm Rust targets" -# run: | -# rustup target add wasm32-wasi -# rustup target add wasm32-unknown-unknown - -# - name: Install latest Rust stable toolchain -# uses: actions-rs/toolchain@v1 -# with: -# toolchain: stable -# default: true -# target: ${{ matrix.config.target }} - -# - name: setup for cross-compiled linux aarch64 build -# if: matrix.config.target == 'aarch64-unknown-linux-gnu' -# run: | -# sudo apt update -# sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -# cd /tmp -# git clone https://github.com/openssl/openssl -# cd openssl -# git checkout OpenSSL_1_1_1l -# sudo mkdir -p $OPENSSL_DIR -# ./Configure linux-aarch64 --prefix=$OPENSSL_DIR --openssldir=$OPENSSL_DIR shared -# make CC=aarch64-linux-gnu-gcc -# sudo make install -# echo '[target.aarch64-unknown-linux-gnu]' >> ${HOME}/.cargo/config.toml -# echo 'linker = "aarch64-linux-gnu-gcc"' >> ${HOME}/.cargo/config.toml - -# - name: setup for cross-compiled darwin aarch64 build -# if: matrix.config.target == 'aarch64-apple-darwin' -# run: | -# cd /tmp -# git clone https://github.com/openssl/openssl -# cd openssl -# git checkout OpenSSL_1_1_1l -# sudo mkdir -p $OPENSSL_DIR -# ./Configure enable-rc5 zlib darwin64-arm64-cc no-asm --prefix=$OPENSSL_DIR --openssldir=$OPENSSL_DIR shared -# sudo make install - -# - name: build release -# uses: actions-rs/cargo@v1 -# with: -# command: build -# args: "--all-features --release ${{ matrix.config.extraArgs }}" - -# - name: package release assets -# shell: bash -# run: | -# mkdir _dist -# cp readme.md LICENSE ${{ matrix.config.targetDir }}/spin${{ matrix.config.extension }} _dist/ -# cd _dist -# tar czf spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz readme.md LICENSE spin${{ matrix.config.extension }} - -# - name: upload binary as GitHub artifact -# uses: actions/upload-artifact@v1 -# with: -# name: spin -# path: _dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz - -# - name: upload binary to canary GitHub release -# uses: svenstaro/upload-release-action@2.2.1 -# if: github.ref == 'refs/heads/main' -# with: -# repo_token: ${{ secrets.GITHUB_TOKEN }} -# file: _dist/spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz -# asset_name: spin-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz -# tag: canary -# overwrite: true -# prerelease: true -# body: | -# This is a "canary" release of the most recent commits on our main branch. Canary is **not stable**. -# It is only intended for developers wishing to try out the latest features in Spin, some of which may not be fully implemented. diff --git a/tests/integration.rs b/tests/integration.rs index 8e88ca60..ffa942bf 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -401,7 +401,7 @@ mod integration_tests { async fn wait_tcp(url: &str, target: &str) -> Result<()> { let mut wait_count = 0; loop { - if wait_count >= 50 { + if wait_count >= 120 { panic!( "Ran out of retries waiting for {} to start on URL {}", target, url @@ -411,7 +411,7 @@ mod integration_tests { Ok(_) => break, Err(_) => { wait_count += 1; - sleep(Duration::from_secs(120)).await; + sleep(Duration::from_secs(1)).await; } } }