Skip to content

OSError: [Errno 2] No such file or directory .lock #4199

@reaperhulk

Description

@reaperhulk

This is likely a new pathlib bug and potentially related to #4181. I suspect this may be occurring because the Jenkins builders where this is happening are running up to 5 concurrent pytest instances. Is there any randomness used to prevent tmpname conflicts or could one process be deleting another's lock?

Example of error:

    def create_cleanup_lock(p):
        """crates a lock to prevent premature folder cleanup"""

        lock_path = get_lock_path(p)
        try:
>           fd = os.open(str(lock_path), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644)

E           OSError: [Errno 2] No such file or directory: 'c:\\users\\admini~1\\appdata\\local\\temp\\2\\pytest-of-Administrator\\pytest-Administrator\\.lock'

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: tmpdirrelated to the tmpdir builtin plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions