ci: Share qa-assets across GitHub Actions jobs #36872

Open
jaromil wants to merge 1 commit from ci/shared-test-assets into master AGit
jaromil commented 2026-11-14 15:33:12 +00:00 (Migrated from github.com)

CI jobs download the same qa-assets inputs separately. As reported in #36814, these repeated requests can fail with HTTP 504 before the tests start.

Add one preparation job that checks out qa-assets once per workflow run and shares the unit-test data and fuzz corpus through Actions artifacts. Linux, macOS and Windows consumers verify the selected revision and file hashes before using them.

Containers mount the shared inputs read-only. Fuzz jobs use separate writable copies. Standalone CI scripts keep direct acquisition through the common download helper.

CI jobs download the same qa-assets inputs separately. As reported in #36814, these repeated requests can fail with HTTP 504 before the tests start. Add one preparation job that checks out qa-assets once per workflow run and shares the unit-test data and fuzz corpus through Actions artifacts. Linux, macOS and Windows consumers verify the selected revision and file hashes before using them. Containers mount the shared inputs read-only. Fuzz jobs use separate writable copies. Standalone CI scripts keep direct acquisition through the common download helper.
DrahtBot commented 2026-11-14 15:33:22 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36627 (tracing: run USDT tests without BPF privileges by willcl-ark)
  • #36147 (ci: add native freeBSD ci job by willcl-ark)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36872 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36872.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36872#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. A summary of reviews will appear here. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36627](https://github.com/bitcoin/bitcoin/pull/36627) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36627.svg"></sub> (tracing: run USDT tests without BPF privileges by willcl-ark) * [#36147](https://github.com/bitcoin/bitcoin/pull/36147) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36147.svg"></sub> (ci: add native freeBSD ci job by willcl-ark) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

Earlier concerns remain unresolved; see the Run archive linked from the Review report.

🟠 Minor · Shared asset preparation now gates matrix entries that never use it

A preparation failure now skips nine build-only or static-analysis matrix entries that never consume qa-assets, and successful runs make them restore an unused artifact.

Location: .github/workflows/ci.yml:415 (head).

🟠 Minor · Three-day asset retention blocks older failed-job reruns

By inspection, failed-job reruns after the three-day artifact expiry cannot restore qa-assets when preparation previously succeeded; a full workflow rerun is needed.

Location: .github/workflows/ci.yml:627 (head).

🟠 Minor · Standalone asset acquisition no longer refreshes or repairs existing files

Persistent standalone workspaces now reuse old script vectors or fail on malformed existing files; no current CI caller supplying a pre-existing file was found.

Location: test/download_utils.py:142 (head).

🔵 Suggestion · Fuzz restoration retains the archive and duplicates source verification

Each fresh fuzz consumer retains the tar alongside two corpus trees and hashes the corpus three times, including two source-verification passes.

Location: test/download_utils.py:163 (head).

🔵 Suggestion · Manifest rejection paths lack negative tests

Normal CI exercises successful asset verification, but does not distinguish it from a verifier that accepts modified files or the wrong revision.

Location: test/download_utils.py:74 (head).

🔵 Suggestion · Prepared-mode rejection is retried as though acquisition failed

With prepared inputs and a differing existing working corpus, the shell retries a deterministic rejection ten times, adding about 196 seconds of backoff plus repeated hashing.

Location: ci/test/03_test_script.sh:63 (head).

Review coverage was incomplete.


Reviewed: 4bdc3e2b380b · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:4afac00dcf2100063250ef321636839508f727ef6ae0cc9ede404a011c46a59f:87c7358e6b1a9709279e41fe01f3f324759c2be7a6239dcb2b0a6d875f8630b0 --> <!-- ralph-base:a527a0077a0fcae913188410214efe98021c0cca --> <!-- ralph-head:4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d --> <!-- ralph-case:893dc416b261c4c852983794b3c3959b4327064fa26e90d2849562a993921653 --> Earlier concerns remain unresolved; see the Run archive linked from the Review report. **🟠 Minor · Shared asset preparation now gates matrix entries that never use it** A preparation failure now skips nine build-only or static-analysis matrix entries that never consume qa-assets, and successful runs make them restore an unused artifact. Location: [`.github/workflows/ci.yml:415`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d/.github/workflows/ci.yml#L415>) (head). **🟠 Minor · Three-day asset retention blocks older failed-job reruns** By inspection, failed-job reruns after the three-day artifact expiry cannot restore qa-assets when preparation previously succeeded; a full workflow rerun is needed. Location: [`.github/workflows/ci.yml:627`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d/.github/workflows/ci.yml#L627>) (head). **🟠 Minor · Standalone asset acquisition no longer refreshes or repairs existing files** Persistent standalone workspaces now reuse old script vectors or fail on malformed existing files; no current CI caller supplying a pre-existing file was found. Location: [`test/download_utils.py:142`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d/test/download_utils.py#L142>) (head). **🔵 Suggestion · Fuzz restoration retains the archive and duplicates source verification** Each fresh fuzz consumer retains the tar alongside two corpus trees and hashes the corpus three times, including two source-verification passes. Location: [`test/download_utils.py:163`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d/test/download_utils.py#L163>) (head). **🔵 Suggestion · Manifest rejection paths lack negative tests** Normal CI exercises successful asset verification, but does not distinguish it from a verifier that accepts modified files or the wrong revision. Location: [`test/download_utils.py:74`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d/test/download_utils.py#L74>) (head). **🔵 Suggestion · Prepared-mode rejection is retried as though acquisition failed** With prepared inputs and a differing existing working corpus, the shell retries a deterministic rejection ten times, adding about 196 seconds of backoff plus repeated hashing. Location: [`ci/test/03_test_script.sh:63`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d/ci/test/03_test_script.sh#L63>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`4bdc3e2b380b`](<https://git.fish.foo/bitcoin/bitcoin/commit/4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d>) · [Review report](<https://review.fish.foo/report/36872-4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d-2686-3.html>) · [Previous reports](<https://review.fish.foo/traces/36872/>) [permalink](<https://review.fish.foo/report/36872-4bdc3e2b380b4f2f5cc4e88ac74013e37f956b4d-2686-3.html>)
maflcko commented 2026-11-19 06:39:15 +00:00 (Migrated from github.com)

thx for working on this, but this is adding ~300 loc, which need to be reviewed, tested, and maintained (as they can contain bugs or require other changes in the future).

IIUC the issue they are trying to fix happened in two pull requests over the last year? It would be good to get an idea of how often this will fix an issue, so that it is clear that the time spent reviewing/maintaining this every year is less than the time it takes to click the re-run CI button every year.

On could also cache other stuff, like https://github.com/bitcoin/bitcoin/issues/33913#issue-3646740449, but this hasn't been done yet either, because it is not worth it.

thx for working on this, but this is adding ~300 loc, which need to be reviewed, tested, and maintained (as they can contain bugs or require other changes in the future). IIUC the issue they are trying to fix happened in two pull requests over the last year? It would be good to get an idea of how often this will fix an issue, so that it is clear that the time spent reviewing/maintaining this every year is less than the time it takes to click the re-run CI button every year. On could also cache other stuff, like https://github.com/bitcoin/bitcoin/issues/33913#issue-3646740449, but this hasn't been done yet either, because it is not worth it.
jaromil commented 2026-11-23 23:34:29 +00:00 (Migrated from github.com)

It just depends how much importance one gives to determinism in tests. Obviously for a cryptographer's mind this is of paramount importance. Failing tests may also drive wrong decision making, re-runs feel like... switch it off and on again, see if that works 😅

It just depends how much importance one gives to determinism in tests. Obviously for a cryptographer's mind this is of paramount importance. Failing tests may also drive wrong decision making, re-runs feel like... switch it off and on again, see if that works 😅
maflcko commented 2026-11-24 06:49:12 +00:00 (Migrated from github.com)

Generally, the tests aren't meant to be 100% deterministic, but rather reproducible, so that failures are actionable. For example, the functional and unit tests can take a random seed, which is logged, for a bit of "property-based" testing. On any test failure, one should trivially see all the actions and inputs that lead to the failure and reproduce the exact failure.

The tests itself should never have any network access (https://github.com/bitcoin/bitcoin/pull/31349), so network io errors can only happen during CI runs. Those can happen in many different places: docker image cache, docker volume cache, package manager downloads, other dependency downloads, depends downloads, previous-release bin downloads, unit test assets, fuzz test assets, ...

Every week there are a few of those network failures, which is extremely annoying, but at the same time something that can't really be fixed: If a cache is created for one resource, then creating the cache can still fail, or downloading the cache itself may fail instead. Also, spotting network failures is generally easier to deal with than a real intermittent ci failure or some of the failures caused by corrupt VM hardware. See https://github.com/bitcoin/bitcoin/issues?q=is%3Aissue+state%3Aclosed+label%3A%22CI+failed%22

Generally, the tests aren't meant to be 100% deterministic, but rather reproducible, so that failures are actionable. For example, the functional and unit tests can take a random seed, which is logged, for a bit of "property-based" testing. On any test failure, one should trivially see all the actions and inputs that lead to the failure and reproduce the exact failure. The tests itself should never have any network access (https://github.com/bitcoin/bitcoin/pull/31349), so network io errors can only happen during CI runs. Those can happen in many different places: docker image cache, docker volume cache, package manager downloads, other dependency downloads, `depends` downloads, previous-release bin downloads, unit test assets, fuzz test assets, ... Every week there are a few of those network failures, which is extremely annoying, but at the same time something that can't really be fixed: If a cache is created for one resource, then creating the cache can still fail, or downloading the cache itself may fail instead. Also, spotting network failures is generally easier to deal with than a real intermittent ci failure or some of the failures caused by corrupt VM hardware. See https://github.com/bitcoin/bitcoin/issues?q=is%3Aissue+state%3Aclosed+label%3A%22CI+failed%22
maflcko commented 2026-11-24 16:06:33 +00:00 (Migrated from github.com)

See e.g:

toomanyrequests: Quota exceeded for quota metric 'Requests per project in the US multi-region' and limit 'Requests per project in the US multi-region per minute' of service 'artifactregistry.googleapis.com' for consumer 'project_number:342927644502'.

https://github.com/bitcoin/bitcoin/actions/runs/45420610531/job/138538761564?pr=36966#step:11:172

And an apt error earlier today, ...

See e.g: ``` toomanyrequests: Quota exceeded for quota metric 'Requests per project in the US multi-region' and limit 'Requests per project in the US multi-region per minute' of service 'artifactregistry.googleapis.com' for consumer 'project_number:342927644502'. ``` https://github.com/bitcoin/bitcoin/actions/runs/45420610531/job/138538761564?pr=36966#step:11:172 And an apt error earlier today, ...
maflcko commented 2026-12-03 09:03:57 +00:00 (Migrated from github.com)

Just for the larger picture, I asked DrahtBot to report all intermittent network issues and this one wasn't hit. Whereas there were many other network issues in other parts:

Using https://github.com/bitcoin-data/github-metadata-backup-bitcoin-bitcoin:

# git grep --only-match --perl-regexp 'Task .* intermittent_network:(.+?)\\n' |     perl -pe 's/intermittent_network/\n/g; s#</sub>\\n$#</sub>\n\n#g'

pulls/35591.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46422669884/job/141861698654</sub>\n<sub>LLM reason (✨ experimental): 
: `apt-get update` failed to fetch Ubuntu security repository package indexes due to connection failures, so dependency setup exited with code 100 before tests ran.</sub>


pulls/35671.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46670896379/job/142725496969</sub>\n<sub>LLM reason (✨ experimental): 
: `apt-get install` failed because Ubuntu package repositories repeatedly returned 503s and connection errors while fetching dependencies.</sub>


pulls/35747.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46673188214/job/142733738530</sub>\n<sub>LLM reason (✨ experimental): 
: Dependency installation failed because Ubuntu package repositories repeatedly returned 503s and connection errors, leaving required packages unavailable.</sub>


pulls/36621.json:Task `MSan`: https://github.com/bitcoin/bitcoin/actions/runs/46905709854/job/143547183789</sub>\n<sub>LLM reason (✨ experimental): 
: Docker image metadata requests to mirror.gcr.io returned HTTP 429 Too Many Requests, preventing the CI container image from building.</sub>


pulls/37026.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46651488623/job/142656575111</sub>\n<sub>LLM reason (✨ experimental): 
: `apt-get update` failed because the Ubuntu security repository connection failed.</sub>


pulls/37029.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46675026856/job/142740372970</sub>\n<sub>LLM reason (✨ experimental): 
: `apt-get update` failed after repeated connection failures fetching Ubuntu security repository indexes, so dependency setup exited with code 100.</sub>


pulls/37047.json:Task `iwyu`: https://github.com/bitcoin/bitcoin/actions/runs/46904405104/job/143542505286</sub>\n<sub>LLM reason (✨ experimental): 
: Docker image retrieval failed because mirror.gcr.io returned HTTP 429 after exceeding its Artifact Registry request quota.</sub>


pulls/37074.json:Task `macOS native`: https://github.com/bitcoin/bitcoin/actions/runs/46964270677/job/143760651550</sub>\n<sub>LLM reason (✨ experimental): 
: Homebrew dependency downloads failed because the runner could not resolve ghcr.io.</sub>



So if this is something to fix, the fix should give a substantial improvement in that problem area. 300LOC for something that doesn't dent the large picture doesn't seem worth it.

I'd say this should be closed, unless a real benefit can be shown.

Just for the larger picture, I asked DrahtBot to report all intermittent network issues and this one wasn't hit. Whereas there were many other network issues in other parts: Using https://github.com/bitcoin-data/github-metadata-backup-bitcoin-bitcoin: ``` # git grep --only-match --perl-regexp 'Task .* intermittent_network:(.+?)\\n' | perl -pe 's/intermittent_network/\n/g; s#</sub>\\n$#</sub>\n\n#g' pulls/35591.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46422669884/job/141861698654</sub>\n<sub>LLM reason (✨ experimental): : `apt-get update` failed to fetch Ubuntu security repository package indexes due to connection failures, so dependency setup exited with code 100 before tests ran.</sub> pulls/35671.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46670896379/job/142725496969</sub>\n<sub>LLM reason (✨ experimental): : `apt-get install` failed because Ubuntu package repositories repeatedly returned 503s and connection errors while fetching dependencies.</sub> pulls/35747.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46673188214/job/142733738530</sub>\n<sub>LLM reason (✨ experimental): : Dependency installation failed because Ubuntu package repositories repeatedly returned 503s and connection errors, leaving required packages unavailable.</sub> pulls/36621.json:Task `MSan`: https://github.com/bitcoin/bitcoin/actions/runs/46905709854/job/143547183789</sub>\n<sub>LLM reason (✨ experimental): : Docker image metadata requests to mirror.gcr.io returned HTTP 429 Too Many Requests, preventing the CI container image from building.</sub> pulls/37026.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46651488623/job/142656575111</sub>\n<sub>LLM reason (✨ experimental): : `apt-get update` failed because the Ubuntu security repository connection failed.</sub> pulls/37029.json:Task `test ancestor commits`: https://github.com/bitcoin/bitcoin/actions/runs/46675026856/job/142740372970</sub>\n<sub>LLM reason (✨ experimental): : `apt-get update` failed after repeated connection failures fetching Ubuntu security repository indexes, so dependency setup exited with code 100.</sub> pulls/37047.json:Task `iwyu`: https://github.com/bitcoin/bitcoin/actions/runs/46904405104/job/143542505286</sub>\n<sub>LLM reason (✨ experimental): : Docker image retrieval failed because mirror.gcr.io returned HTTP 429 after exceeding its Artifact Registry request quota.</sub> pulls/37074.json:Task `macOS native`: https://github.com/bitcoin/bitcoin/actions/runs/46964270677/job/143760651550</sub>\n<sub>LLM reason (✨ experimental): : Homebrew dependency downloads failed because the runner could not resolve ghcr.io.</sub> ``` So if this is something to fix, the fix should give a substantial improvement in that problem area. 300LOC for something that doesn't dent the large picture doesn't seem worth it. I'd say this should be closed, unless a real benefit can be shown.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36872
No description provided.