Skip to content

Make sure download.test does not fail due to a checksum collision in the download cache#6378

Merged
rjbou merged 1 commit intoocaml:masterfrom
kit-ty-kate:reftest-checksum-collision
Feb 5, 2025
Merged

Make sure download.test does not fail due to a checksum collision in the download cache#6378
rjbou merged 1 commit intoocaml:masterfrom
kit-ty-kate:reftest-checksum-collision

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

Example of random failure: https://github.com/ocaml/opam/actions/runs/13137623611/job/36656730451?pr=6273

 diff --git a/_build/default/tests/reftests/download.test b/_build/default/tests/reftests/download.out
File "tests/reftests/download.test", line 1, characters 0-0:
"C:\Program Files\Git\cmd\git.exe" --no-pager diff --no-index --color=always -u --ignore-cr-at-eol _build/default/tests/reftests/download.test _build/default/tests/reftests/download.out
Command exited with code 1.
index c01c510..e2a08c0 100644
--- a/_build/default/tests/reftests/download.test
+++ b/_build/default/tests/reftests/download.out
@@ -262,7 +262,6 @@ SYSTEM                          mkdir ${OPAMTMP}
 Processing  1/1: [baz.1: http]
 + wget "--header=Accept: */*" "-t" "3" "-O" "${OPAMTMP}/v1.0.0.tar.gz.part" "-U" "opam/current" "--" "https://github.com/UnixJunkie/get_line/archive/v1.0.0.tar.gz"
 SYSTEM                          mv ${OPAMTMP}/v1.0.0.tar.gz.part -> ${OPAMTMP}/v1.0.0.tar.gz
-SYSTEM                          mkdir ${BASEDIR}/OPAM/download-cache/md5-dir/
 SYSTEM                          copy ${OPAMTMP}/v1.0.0.tar.gz -> ${BASEDIR}/OPAM/download-cache/md5-dir/
 SYSTEM                          mkdir ${OPAMTMP}
 Processing  1/1: [baz.1: extract]

This happens because some archives are being created above in the tests and their checksums will vary with the time of day so in some cases a collision will happen with the fix get_line archive

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Feb 4, 2025
@kit-ty-kate kit-ty-kate requested a review from rjbou February 4, 2025 16:07
@rjbou rjbou force-pushed the reftest-checksum-collision branch from a386c68 to 34500f0 Compare February 5, 2025 14:17
@rjbou rjbou merged commit 42b8619 into ocaml:master Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants