util.dirs() yields directories in arbitrary order, which has made
test-doctest.py flaky. I think they have been flaky since d8e55c0c642c
(util: make util.dirs() and util.finddirs() include root directory
(API), 2017-05-16). Before that commit, I think util.dirs() would
return at most one entry, so there was only one iteration order. This
patch fixes the problem by making _rootsdirsandparents() return a set
(whose str() is defined to be in sorted order, I believe). The
only caller wanted a set anyway.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGc4b8f8637d7a: match: de-flake test-doctest.py by not depending on util.dirs() order
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
@@ -1384,26 +1384,26 @@
>>> _rootsdirsandparents( ... [(b'glob', b'g/h/*', b''), (b'glob', b'g/h', b''), ... (b'glob', b'g*', b'')])
- (['g/h', 'g/h', ''], [], ['', 'g'])
+ (['g/h', 'g/h', ''], [], set(['', 'g']))
Perhaps, this would break py3 doctests. The repr syntax changed.
Comment Actions
Good point. However, it turns out they were already broken (b'' prefixes), so I'll leave it for the py3 folks to clean up.
Comment Actions
> > @@ -1384,26 +1384,26 @@ > > > > >>> _rootsdirsandparents( > > ... [(b'glob', b'g/h/*', b''), (b'glob', b'g/h', b''), > > ... (b'glob', b'g*', b'')]) > > > > - (['g/h', 'g/h', ''], [], ['', 'g']) + (['g/h', 'g/h', ''], [], set(['', 'g'])) > > Perhaps, this would break py3 doctests. The repr syntax changed. Good point. However, it turns out they were already broken (b'' prefixes), so I'll leave it for the py3 folks to clean up.
FYI, there's a weird hack to normalize '', u'', and b'' because that's the
only way to make doctests portable.