Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileList.files order discrepancy on Arch Linux since 28.5.0 #816

Closed
felixonmars opened this issue Oct 17, 2016 · 4 comments
Closed

FileList.files order discrepancy on Arch Linux since 28.5.0 #816

felixonmars opened this issue Oct 17, 2016 · 4 comments

Comments

@felixonmars
Copy link
Contributor

Reproduced in both Python 2.7.12 and 3.5.2. I have tried both ptr and tox and still getting the same test failure:

=================================== FAILURES ===================================
____________________ TestFileListTest.test_include_pattern _____________________

self = <setuptools.tests.test_manifest.TestFileListTest object at 0x7fe946df4860>

    def test_include_pattern(self):
        # return False if no match
        file_list = FileList()
        self.make_files([])
        assert not file_list.include_pattern('*.py')

        # return True if files match
        file_list = FileList()
        self.make_files(['a.py', 'b.txt'])
        assert file_list.include_pattern('*.py')

        # test * matches all files
        file_list = FileList()
        self.make_files(['a.py', 'b.txt'])
        file_list.include_pattern('*')
>       assert file_list.files == ['a.py', 'b.txt']
E       assert ['b.txt', 'a.py'] == ['a.py', 'b.txt']
E         At index 0 diff: 'b.txt' != 'a.py'
E         Use -v to get the full diff
@jaraco
Copy link
Member

jaraco commented Oct 17, 2016

Any idea why the tests pass on Travis? Is it perhaps an intermittent failure?

@felixonmars
Copy link
Contributor Author

felixonmars commented Oct 17, 2016

No idea yet. I have tried to play with PYTHONHASHSEED and got not difference. It is still 100% reproducible on all three of my Arch Linux x86_64 machines.

@jaraco jaraco changed the title Test failure since 28.5.0 FileList.files order discrepancy on Arch Linux since 28.5.0 Oct 17, 2016
@jaraco
Copy link
Member

jaraco commented Oct 17, 2016

Probably implicated is #764. @timheap Can you assist?

mx-moth added a commit to mx-moth/setuptools that referenced this issue Oct 17, 2016
Different OS's and file systems return lists of files in different
orders, not always creation order. This caused intermittent test
failures.

The file list is now sorted prior to being checked to ensure a
consistent order across all systems.

Fixes pypa#816
@mx-moth
Copy link
Contributor

mx-moth commented Oct 17, 2016

Different OSs and file systems do not always list files in creation order it appears, so the tests fail on some systems. I've added a file_list.sort() before each assertion in the tests to ensure a consistent order, over in #818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants