Skip to content

Test failure with file 5.46

Hi, recently Arch upgraded file to version 5.46. As it happens, I've been building diffoscope and found this issue.

    @skip_unless_file_version_is_at_least("5.37")
    def test_difference(differences):
        expected_diff = get_data("quine_expected_diff")
        if file_version_is_ge("5.40"):
            expected_diff = expected_diff[:-1]
            expected_diff += ", compression method=deflate\n"
>       assert differences[0].unified_diff == expected_diff
E       AssertionError: assert '@@ -1 +1 @@\...hod=deflate\n' == '@@ -1 +1 @@\...hod=deflate\n'
E
E         Skipping 100 identical leading characters in diff, use -v to show
E         - ive data, at least v2.0 to extract, compression method=deflate
E         + ive data, made by v2.0, extract using at least v2.0, last modified, last modified Sun, Mar 04 2010 00:24:16, uncompressed size 440, method=deflate

tests/test_quines.py:63: AssertionError

Investigation

Searching for this issue, I found #251 (closed). Indeed, running file separately shows the response:

$ file --version
file-5.46
magic file from /usr/share/file/misc/magic
seccomp support included
$ file tests/data/quine.zip
tests/data/quine.zip: Zip archive data, made by v2.0, extract using at least v2.0, last modified, last modified Sun, Mar 04 2010 00:24:16, uncompressed size 440, method=deflate

Running the build with file 5.45 completes fine.

Analysis

The changed output of file is at fault. The fix probably requires another conditional here to support the new message.

Appendix

diffoscope-283-1-x86_64-check.log

Edited by Vekhir
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information