diff --git a/.config/nextest.toml b/.config/nextest.toml index 0ed0952fa6a2..11d1a92cc3e9 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -38,6 +38,6 @@ slow-timeout = { period = "120s", terminate-after = 3 } # There might be some network issues, so we allow some retries with backoff. # Jitter is enabled to avoid [thundering herd issues](https://en.wikipedia.org/wiki/Thundering_herd_problem). [[profile.default.overrides]] -filter = 'test(rpc_test_)' +filter = 'test(rpc_snapshot_test_)' slow-timeout = { period = "120s", terminate-after = 3 } -retries = { backoff = "exponential", count = 4, delay = "5s", jitter = true } +retries = { backoff = "exponential", count = 3, delay = "5s", jitter = true } diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f740ef31a6d8..7f9ff7518516 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -64,6 +64,13 @@ jobs: continue-on-error: true - name: Checkout Sources uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: | + /home/runner/.cache/forest/test/rpc-snapshots/rpc_test + # Broad key + prefix-based restore so the latest rpcsnap- is picked up. + key: rpcsnap- + enableCrossOsArchive: true - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.9 timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }} @@ -77,3 +84,14 @@ jobs: env: # To minimize compile times: https://nnethercote.github.io/perf-book/build-configuration.html#minimizing-compile-times RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld" + - id: get-cache-hash + run: | + ls -lhR ~/.cache/forest/test/rpc-snapshots/rpc_test/* + echo "hash=$(openssl md5 ~/.cache/forest/test/rpc-snapshots/rpc_test/* | sort | openssl md5 | cut -d ' ' -f 2)" >> $GITHUB_OUTPUT + shell: bash + - uses: actions/cache/save@v4 + with: + path: | + /home/runner/.cache/forest/test/rpc-snapshots/rpc_test + key: rpcsnap-${{ steps.get-cache-hash.outputs.hash }} + enableCrossOsArchive: true diff --git a/build.rs b/build.rs index 7c748c7d93e9..f467e5f161d2 100644 --- a/build.rs +++ b/build.rs @@ -79,7 +79,7 @@ fn rpc_regression_tests_gen() { w, r#" #[tokio::test(flavor = "multi_thread")] - async fn rpc_test_{ident}() {{ + async fn rpc_snapshot_test_{ident}() {{ rpc_regression_test_run("{test}").await }} "#,