This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_os / test_listdir failed as root-directory changed during test
Type: behavior Stage: patch review
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Matthias Braun
Priority: normal Keywords: patch

Created on 2020-03-17 02:22 by Matthias Braun, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 19035 open Matthias Braun, 2020-03-17 02:39
Messages (1)
msg364383 - (view) Author: Matthias Braun (Matthias Braun) * Date: 2020-03-17 02:22
The test_listdir test from Lib/test/test_os.py is using os.listdir() twice in the root directory with and without parameters and compares the results. I just had the test fail for me, because an unrelated process happened to create a file in the root directory between the two invocations of os.listdir. In my case it was rsyslog creating '/imjournal.state.tmp', but the problem is a general one.

The test failed with:
```
   ..test test_os failed -- Traceback (most recent call last):
  File "/home/matthiasb/dev/fbcpython/Lib/test/test_os.py", line 1914, in test_listdir
    self.assertEqual(set(os.listdir()), set(os.listdir(os.sep)))
AssertionError: Items in the first set but not the second:
'imjournal.state.tmp'
```
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84167
2022-01-15 20:39:51iritkatrielsetversions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.7
2020-03-17 02:39:46Matthias Braunsetkeywords: + patch
stage: patch review
pull_requests: + pull_request18386
2020-03-17 02:22:20Matthias Brauncreate