New submission from Robert Collins:

Openstack recently switched from nose to using discover. discover walks the 
filesystem using os.listdir(), and that is just a thin layer over readdir. On 
ext3/ext4 filesystems, readdir is in an arbitrary order dependent on file 
insertion into the directory if dir_index is enabled (which is the default).

This means that files are loaded in an order that isn't reproducable by other 
developers, so bad tests that have isolation issues can be very tricky to track 
down.

Just wrapping the os.listdir() in sorted() would be sufficient to make this 
robust and repeatable, and avoid the headache.

----------
components: Library (Lib)
messages: 177675
nosy: ezio.melotti, michael.foord, pitrou, rbcollins
priority: normal
severity: normal
status: open
title: unittest discover order is filesystem specific - hard to reproduce
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16709>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to