Conversation
…runs - evm_block_explorer: query a post-Merge block. PublicNode routes across regional pools and some only retain history from block ~15500000, so the block 1 assertions failed with `pruned history unavailable` depending on which pool served the outcall. - unit_testable_rust_canister: prepare each test WASM once per test binary. Two tests downloaded the NNS governance WASM concurrently to the same path, and `fs::write` truncating under the peer's `fs::read` produced a partial gzip that PocketIC rejected as `CanisterInvalidWasm`. curl's exit status was also unchecked, so a failed transfer was cached as a valid artifact. - _run-example.yml: warm the mops toolchain cache. Projects with more than one Motoko canister run concurrent `mops build` invocations that race on the shared moc download and extraction, failing the build with no diagnostics. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…-unique Keeps the atomic-rename guarantee if the tests are ever run per-process (cargo nextest) or in two checkouts at once, rather than relying on libtest running tests as threads within one process. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Truncated gzip cache entries must be fully validated before reuse.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR reduces weekly CI flakiness across EVM, Rust, and Motoko examples.
Changes:
- Uses retained Ethereum block 20,000,000 and documents pruning limitations.
- Synchronizes and hardens Rust WASM downloads.
- Pre-warms Motoko toolchain caches in CI.
File summaries
| File | Reviewed changes |
|---|---|
rust/unit_testable_rust_canister/backend/tests/integration_tests.rs |
Synchronizes artifact preparation and adds reliable downloads. Moderate finding: truncated gzip cache entries are not fully validated. |
rust/evm_block_explorer/test.sh |
Tests a retained Ethereum block. |
rust/evm_block_explorer/README.md |
Documents PublicNode history limitations. |
motoko/evm_block_explorer/test.sh |
Tests a retained Ethereum block. |
motoko/evm_block_explorer/README.md |
Documents PublicNode history limitations. |
.github/workflows/_run-example.yml |
Pre-warms the Motoko toolchain cache. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The magic-prefix check accepted a truncated archive left behind by an earlier interrupted download, so a corrupt cache entry survived and kept failing as CanisterInvalidWasm. Decoding the stream covers the trailing CRC and length, and a corrupt entry is now replaced rather than reused. flate2 is already built for the test profile via pocket-ic. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three unrelated causes behind the weekly-run failures, each reproduced before fixing.
evm_block_explorer(not flaky — reliably broken)test.shasserted on Ethereum mainnet block 1. PublicNode routes requests across regional node pools and some of them only retain history from shortly before the Merge, so the call comes back aspruned history unavailable: requested 1, earliest available 15500000depending on which pool serves the outcall. Both the Motoko and Rust jobs failed on it, and re-running does not help from a region whose pool is pruned.Now asserts on block
20000000(post-Merge, ~4.5M blocks above that boundary). Verified locally: all three assertions pass. The READMEs note the limitation so users who query early blocks in the frontend know why it fails.unit_testable_rust_canister(flaky)test_get_proposal_infoandtest_get_proposal_titlesboth callget_governance_wasm(), which downloaded to a single shared path with no synchronisation. libtest runs them on separate threads, sostd::fs::writetruncating the file under the peer'sstd::fs::readyields a partial gzip — surfacing as the opaqueCanisterInvalidWasm: unsupported canister module formatin the failed run.curl's exit status was also never checked, so a failed transfer wrote an empty file that theexists()check would then treat as a valid cached artifact.Each artifact is now prepared exactly once per test binary behind a
LazyLock, the download is status-checked with retries, and it lands via a temp file + rename so a partial transfer is never cached.parallel_calls/pub-sub— Motoko jobs only (flaky, upstream bug)Both are the only Motoko examples with two canisters in one mops project. icp-cli runs one
mops build <canister>per canister concurrently, and on a cold cache both invocations download and extract the moc toolchain into the same two shared locations —.mops/_tmp/motoko-Linux-x86_64-<ver>.tar.gzand~/.cache/mops/moc/<ver>. Whichever build loses reads a half-written archive or execs a half-extractedmoc, and the failure surfaces asBuild failed for canister <name> (exit code: undefined)with no diagnostics — or, when the timing lands differently, as theZlibError: zlib: unexpected end of filevisible in run 32750148987.That matches which canister fails being random across runs (
caller,callee,publisher,subscriberhave all appeared) and only ever in these two projects.Reproduced locally with
icp buildonmotoko/pub-sub, 3/3 failures on a cold moc cache, and still present on the latest mops (3.2.0). It is a mops bug, filed as caffeinelabs/mops#818 with the offending code path and a minimal reproduction.mops installup front makes the download happen once, which is what this adds to_run-example.yml; 4/4 clean afterwards. Guarded onmops.tomlexisting andmopsbeing on PATH, so it is a no-op for Rust examples, and to be removed once the upstream fix ships.🤖 Generated with Claude Code