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

test_os / test_listdir failed as root-directory changed during test #84167

Open
MatzeB mannequin opened this issue Mar 17, 2020 · 1 comment
Open

test_os / test_listdir failed as root-directory changed during test #84167

MatzeB mannequin opened this issue Mar 17, 2020 · 1 comment
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@MatzeB
Copy link
Mannequin

MatzeB mannequin commented Mar 17, 2020

BPO 39986
Nosy @MatzeB
PRs
  • bpo-39986: Make test_listdir from test_os more robust #19035
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2020-03-17.02:22:20.725>
    labels = ['type-bug', 'tests', '3.9', '3.10', '3.11']
    title = 'test_os / test_listdir failed as root-directory changed during test'
    updated_at = <Date 2022-01-15.20:39:51.330>
    user = 'https://github.com/MatzeB'

    bugs.python.org fields:

    activity = <Date 2022-01-15.20:39:51.330>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2020-03-17.02:22:20.725>
    creator = 'Matthias Braun'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39986
    keywords = ['patch']
    message_count = 1.0
    messages = ['364383']
    nosy_count = 1.0
    nosy_names = ['Matthias Braun']
    pr_nums = ['19035']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39986'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @MatzeB
    Copy link
    Mannequin Author

    MatzeB mannequin commented Mar 17, 2020

    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'
    

    @MatzeB MatzeB mannequin added 3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Mar 17, 2020
    @iritkatriel iritkatriel added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes and removed 3.7 (EOL) end of life labels Jan 15, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant