Skip to content

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

Open
jaromil wants to merge 1 commit into
bitcoin:masterfrom
jaromil:ci/shared-test-assets
Open

jaromil wants to merge 1 commit into
bitcoin:masterfrom
jaromil:ci/shared-test-assets

Conversation

@jaromil

@jaromil jaromil commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

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 DrahtBot added the Tests label Nov 14, 2026
@DrahtBot

DrahtBot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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.

@jaromil
jaromil marked this pull request as draft November 14, 2026 15:57
@jaromil
jaromil force-pushed the ci/shared-test-assets branch from 7e7d363 to bf815ab Compare November 14, 2026 16:55
Acquire qa-assets once per workflow run and distribute verified unit
vectors and fuzz inputs through same-run artifacts. Reuse the common
helper for Linux, macOS and Windows consumers instead of downloading the
same inputs in each job.

Package the inputs as tar files so the artifact downloader extracts one
file instead of many small corpus files. Let artifact ZIP compression
handle the transfer and extract the tar before verification.

Record the selected revision and file hashes, mount shared inputs
read-only in containers, and give fuzz jobs separate writable copies.
Keep standalone acquisition and select a fresh snapshot each run.

Refs bitcoin#36814.
@maflcko

maflcko commented Nov 19, 2026

Copy link
Copy Markdown
Member

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 #33913 (comment), but this hasn't been done yet either, because it is not worth it.

@jaromil

jaromil commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

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

maflcko commented Nov 24, 2026

Copy link
Copy Markdown
Member

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 (#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

maflcko commented Nov 24, 2026

Copy link
Copy Markdown
Member

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

maflcko commented Dec 3, 2026

Copy link
Copy Markdown
Member

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants