[New-bugs-announce] [issue16709] unittest discover order is filesystem specific - hard to reproduce
report at bugs.python.org
Tue Dec 18 03:28:57 CET 2012
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)
nosy: ezio.melotti, michael.foord, pitrou, rbcollins
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 <report at bugs.python.org>
More information about the New-bugs-announce