hexpm / hex_core

Reference implementation of Hex specifications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disk test checksum mismatch

aerosol opened this issue · comments

commented
Failures:

  1) hex_tarball_tests:disk_test/0
     Failure/Error: {error,
                        {badmatch,
                            <<"BB994E006EA06B74A6A4C72C0C42B565C0E510A3B24D211D46EEF77C4CFED49F">>},
                        [{hex_tarball_tests,'-disk_test/0-fun-0-',0,
                             [{file,
                                  "/home/hq1/dev/hex_erl/_build/test/lib/hex_erl/test/hex_tarball_tests.erl"},
                              {line,24}]},
                         {hex_tarball_tests,in_tmp,1,
                             [{file,
                                  "/home/hq1/dev/hex_erl/_build/test/lib/hex_erl/test/hex_tarball_tests.erl"},
                              {line,188}]}]}
     Output:


Top 10 slowest tests (0.038 seconds, 18.4% of total time):
  hex_registry_tests:signed_test/0
    0.010 seconds
  hex_tarball_tests:disk_test/0
    0.005 seconds
  hex_tarball_tests:unpack_error_handling_test/0
    0.005 seconds
  hex_tarball_tests:timestamps_and_permissions_test/0
    0.004 seconds
  hex_repo_tests:get_names_test/0
    0.003 seconds
  hex_repo_tests:get_package_test/0
    0.003 seconds
  hex_repo_tests:get_tarball_test/0
    0.003 seconds
  hex_tarball_tests:build_tools_test/0
    0.002 seconds
  hex_repo_tests:get_versions_test/0
    0.002 seconds
  hex_tarball_tests:memory_test/0
    0.001 seconds
commented

byte2byte comparison:

Output: 

35 33 37 38 37 66 39 64 38 37 61 -- 39 64 65 39   42 42 39 39 34 45 30 30 36 45 41 -- 36 42 37 34
61 33 31 66 62 32 66 33 36 37 65 37 35 63 64 65   41 36 41 34 43 37 32 43 30 43 34 32 42 35 36 35
39 32 36 30 35 36 34 -- 61 39 38 32 65 30 32 31   43 30 45 35 31 30 41 -- 42 32 34 44 32 31 31 44
30 30 30 61 32 65 63 61 63 36 33 38 34 62 32 31   34 36 45 45 46 37 37 43 34 43 46 45 44 34 39 46

commented

Decoded diff:

53 78 7F 9D 87 -- 9D E9 A3 1F B2 F3 67 E7 5C DE   BB 99 4E 00 6E -- 6B 74 A6 A4 C7 2C 0C 42 B5 65
92 60 56 43 A9 82 E0 21 00 0A 2E CA C6 38 4B 21   C0 E5 10 A3 B2 4D 21 1D 46 EE F7 7C 4C FE D4 9F

Thanks for the report. To get a few things straight:

  1. the test is not flaky, it fails every single time right?
  2. I know you're using linux, what's your OTP version and any other information that might be relevant? what's your zlib version? I gotta feeling it's related to zlib, we had similar issue before e.g. hexpm/hex#484. What's weird CI runs on linux and it's good there.
commented

@wojtekmach

  1. Yeah, this is 100% reproducible on my machines.
  2. OTP 20.2 (asdf build), zlib 1.2.11
commented

Ah, thanks for the header hint. Comparing SHA256 hashes is not too useful :)

commented

Here's what I'm really getting:

ChecksumBase16 <<"BB994E006EA06B74A6A4C72C0C42B565C0E510A3B24D211D46EEF77C4CFED49F">>

ContentsBinary:
0000 1F 8B 08 00 00 00 00 00 00 00 4B CB CF D7 4B 2D  .........K-
0001 CA 61 A0 25 30 30 34 30 30 33 33 61 30 80 00 74  %0040033a0.t
0002 DA C0 C0 D0 94 C1 C0 DC C0 D8 D8 C8 C4 D0 0C 2C  Д,
0003 6E 68 60 6A 04 14 A3 A9 AB A0 A0 B4 B8 24 B1 08  nh`j..$.
0004 68 25 A5 E6 A0 7B 6E 88 00 DD DC FC 94 D2 9C 54  h%n.ҜT
0005 8D B4 FC 7C 4D BD 81 76 CC 28 18 05 A3 60 14 8C  |Mv..`.
0006 02 BA 01 00 E0 03 3E 38 00 08 00 00              ...>8....

MetadataBinary:
0000 7B 3C 3C 22 61 70 70 22 3E 3E 2C 3C 3C 22 66 6F  {<<"app">>,<<"fo
0001 6F 22 3E 3E 7D 2E 0A 7B 3C 3C 22 62 75 69 6C 64  o">>}..{<<"build
0002 5F 74 6F 6F 6C 22 3E 3E 2C 3C 3C 22 72 65 62 61  _tool">>,<<"reba
0003 72 33 22 3E 3E 7D 2E 0A 7B 3C 3C 22 76 65 72 73  r3">>}..{<<"vers
0004 69 6F 6E 22 3E 3E 2C 3C 3C 22 31 2E 30 2E 30 22  ion">>,<<"1.0.0"
0005 3E 3E 7D 2E 0A                                   >>}..

@aerosol The checksum is based on the tarball, so we need to diff the tarball generated and a tarball generated on a machine where the test passes. It is also possible it's a change to the compression library, like @wojtekmach said, and then we only have to diff the contents binary.

commented

Turns out it was 664 vs 644. Branch updated. Test now passes on 🐧

Fixed in #10