git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Test breakage with zlib-ng

From
Ondrej Pohorelsky <opohorel@redhat.com>
Date
Dec 12, 2023, 14:16 UTC
Message-ID
<CA+B51BEpSh1wT627Efpysw3evVocpiDCoQ3Xaza6jKE3B62yig@mail.gmail.com>
Hi everyone,

As some might have heard, there is a proposal for Fedora 40 to transition from zlib to zlib-ng[0]. Because of this, there has been a rebuild of all packages to ensure every package works under zlib-ng.

Git test suit has three breakages in t6300-for-each-ref.sh. To be precise, it is:

not ok 35 - basic atom: refs/heads/main objectsize:disk not ok 107 - basic atom: refs/tags/testtag objectsize:disk not ok 108 - basic atom: refs/tags/testtag *objectsize:disk

All of these tests are atomic, and they compare the result against $disklen. I discussed it with Tulio Magno Quites Machado Filho, who ran the tests and is owner of the proposal. It seems like the compression of zlib-ng is shaving/adding some bytes to the actual output, which then fails the comparison.

Here is an example:

``` expecting success of 6300.35 'basic atom: refs/heads/main objectsize:disk': git for-each-ref --format="%($format)" "$ref" >actual && sanitize_pgp <actual >actual.clean && test_cmp expected actual.clean

++ git for-each-ref '--format=%(objectsize:disk)' refs/heads/main ++ sanitize_pgp ++ perl -ne ' /^-----END PGP/ and $in_pgp = 0; print unless $in_pgp; /^-----BEGIN PGP/ and $in_pgp = 1; ' ++ command /usr/bin/perl -ne ' /^-----END PGP/ and $in_pgp = 0; print unless $in_pgp; /^-----BEGIN PGP/ and $in_pgp = 1; ' ++ test_cmp expected actual.clean ++ test 2 -ne 2 ++ eval 'diff -u' '"$@"' +++ diff -u expected actual.clean --- expected 2023-12-06 21:06:07.808849497 +0000 +++ actual.clean 2023-12-06 21:06:07.812849541 +0000

@@ -1 +1 @@
-138
+137
error: last command exited with $?=1
not ok 35 - basic atom: refs/heads/main objectsize:disk
```

The whole build log can be found here[1].

I can easily patch these tests in Fedora to be compatible with zlib-ng
only by not comparing to $disklen, but a concrete value, however I
would like to have a universal solution that works with both zlib and
zlib-ng. So if anyone has an idea on how to do it, please let me know.
Thanks


[0]https://discussion.fedoraproject.org/t/f40-change-proposal-transitioning-to-zlib-ng-as-a-compatible-replacement-for-zlib-system-wide/95807
[1]https://download.copr.fedorainfracloud.org/results/tuliom/zlib-ng-compat-mpb/fedora-rawhide-x86_64/06729801-git/builder-live.log.gz

Cheers,
Ondřej Pohořelský
Next: René Scharfe
Message 1 of 17 in “Test breakage with zlib-ng”
  1. Ondrej PohorelskyDec 12, 2023
  2. René ScharfeDec 12, 2023
  3. Jeff KingDec 12, 2023
  4. René ScharfeDec 12, 2023
  5. 2/1 test-lib-functions: add object size functionsRené Scharfe, Dec 13, 2023
  6. Jeff KingDec 14, 2023
  7. René ScharfeDec 19, 2023
  8. t1006: add tests for %(objectsize:disk)Jeff King, Dec 21, 2023
  9. René ScharfeDec 21, 2023
  10. Jeff KingDec 21, 2023
  11. René ScharfeDec 21, 2023
  12. t1006: add tests for %(objectsize:disk)Jeff King, Dec 23, 2023
  13. René ScharfeDec 24, 2023
  14. Jeff KingDec 23, 2023
  15. René ScharfeDec 24, 2023
  16. brian m. carlsonDec 12, 2023
  17. Junio C HamanoDec 12, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.