From 328e7690f3e69ac7567da1ed5f404c6a9d2d8e8f Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 15 Apr 2021 01:15:06 +0800 Subject: [PATCH] Fix sanity test flakiness by prebuilding binaries (#16530) * Fix sanity test flakiness by prebuilding binaries * ignore shellcheck * bump * nudge * simplify --- ci/localnet-sanity.sh | 2 +- frozen-abi/src/lib.rs | 1 - multinode-demo/common.sh | 21 ++++++++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ci/localnet-sanity.sh b/ci/localnet-sanity.sh index bb555700b..d5dbf12a5 100755 --- a/ci/localnet-sanity.sh +++ b/ci/localnet-sanity.sh @@ -70,7 +70,7 @@ done source ci/upload-ci-artifact.sh source scripts/configure-metrics.sh -source multinode-demo/common.sh +source multinode-demo/common.sh --prebuild nodes=( "multinode-demo/bootstrap-validator.sh \ diff --git a/frozen-abi/src/lib.rs b/frozen-abi/src/lib.rs index a32701f07..189535ccd 100644 --- a/frozen-abi/src/lib.rs +++ b/frozen-abi/src/lib.rs @@ -9,7 +9,6 @@ extern crate self as solana_frozen_abi; pub mod abi_digester; #[cfg(RUSTC_WITH_SPECIALIZATION)] pub mod abi_example; - #[cfg(RUSTC_WITH_SPECIALIZATION)] mod hash; diff --git a/multinode-demo/common.sh b/multinode-demo/common.sh index e1f1544d2..9ae9331cb 100644 --- a/multinode-demo/common.sh +++ b/multinode-demo/common.sh @@ -10,6 +10,11 @@ # shellcheck source=net/common.sh source "$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. || exit 1; pwd)"/net/common.sh +prebuild= +if [[ $1 = "--prebuild" ]]; then + prebuild=true +fi + if [[ $(uname) != Linux ]]; then # Protect against unsupported configurations to prevent non-obvious errors # later. Arguably these should be fatal errors but for now prefer tolerance. @@ -39,14 +44,20 @@ else program="solana-$program" fi - if [[ -r "$SOLANA_ROOT/$crate"/Cargo.toml ]]; then - maybe_package="--package solana-$crate" - fi if [[ -n $NDEBUG ]]; then maybe_release=--release fi - declare manifest_path="--manifest-path=$SOLANA_ROOT/$crate/Cargo.toml" - printf "cargo $CARGO_TOOLCHAIN run $manifest_path $maybe_release $maybe_package --bin %s %s -- " "$program" + + # Prebuild binaries so that CI sanity check timeout doesn't include build time + if [[ $prebuild ]]; then + ( + set -x + # shellcheck disable=SC2086 # Don't want to double quote + cargo $CARGO_TOOLCHAIN build $maybe_release --bin $program + ) + fi + + printf "cargo $CARGO_TOOLCHAIN run $maybe_release --bin %s %s -- " "$program" } fi