pytest: FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-jenkins/pytest-0/.lock'
Hi there -
Just need to know what’s happening on this one, this seems to be new code in py.test in version 3.9.1, my other build server running 3.8.2 doesn’t have this issue.
is there…some kind of revolving numeric scheme such that more than one runner (I’m using pytest-xdist, 1.23.2 on both environments) is conflicting on this?
this is SQLAlchemy’s test suite running on jenkins.
stack trace:
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/pathlib.py", line 127, in create_cleanup_lock
INTERNALERROR> fd = os.open(str(lock_path), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644)
INTERNALERROR> FileExistsError: [Errno 17] File exists: '/tmp/pytest-of-jenkins/pytest-0/.lock'
INTERNALERROR>
INTERNALERROR> The above exception was the direct cause of the following exception:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/main.py", line 179, in wrap_session
INTERNALERROR> config.hook.pytest_sessionstart(session=session)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/xdist/dsession.py", line 81, in pytest_sessionstart
INTERNALERROR> nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/xdist/workermanage.py", line 67, in setup_nodes
INTERNALERROR> nodes.append(self.setup_node(spec, putevent))
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/xdist/workermanage.py", line 76, in setup_node
INTERNALERROR> node.setup()
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/xdist/workermanage.py", line 242, in setup
INTERNALERROR> basetemp = self.config._tmpdirhandler.getbasetemp()
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/tmpdir.py", line 107, in getbasetemp
INTERNALERROR> return py.path.local(self._tmppath_factory.getbasetemp().resolve())
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/tmpdir.py", line 66, in getbasetemp
INTERNALERROR> prefix="pytest-", root=rootdir, keep=3, lock_timeout=LOCK_TIMEOUT
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/pathlib.py", line 235, in make_numbered_dir_with_cleanup
INTERNALERROR> consider_lock_dead_if_created_before=consider_lock_dead_if_created_before,
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/pathlib.py", line 214, in cleanup_numbered_dir
INTERNALERROR> try_cleanup(path, consider_lock_dead_if_created_before)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/pathlib.py", line 196, in try_cleanup
INTERNALERROR> delete_a_numbered_dir(path)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/pathlib.py", line 166, in delete_a_numbered_dir
INTERNALERROR> create_cleanup_lock(path)
INTERNALERROR> File "/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/_pytest/pathlib.py", line 131, in create_cleanup_lock
INTERNALERROR> EnvironmentError("cannot create lockfile in {path}".format(path=p)), e
INTERNALERROR> File "<string>", line 3, in raise_from
INTERNALERROR> OSError: cannot create lockfile in /tmp/pytest-of-jenkins/pytest-0
/home/jenkins/workspace/sqlalchemy_gerrit/b3d9d1a2/.tox/py37-cext-sqlite-postgresql/lib/python3.7/site-packages/psycopg2
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 15 (11 by maintainers)
Commits related to this issue
- block py.test 3.9.1 references: https://github.com/pytest-dev/pytest/issues/4181 Change-Id: I216fde19dd0f5c4910d76c08400f2329b09ad584 — committed to zzzeek/sqlalchemy by zzzeek 6 years ago
- block py.test 3.9.1 references: https://github.com/pytest-dev/pytest/issues/4181 Change-Id: I216fde19dd0f5c4910d76c08400f2329b09ad584 (cherry picked from commit b4d42a84e22652c16b914a2f76421718be91... — committed to zzzeek/sqlalchemy by zzzeek 6 years ago
- block py.test 3.9.1 references: https://github.com/pytest-dev/pytest/issues/4181 Change-Id: Iad3b6845e94753c55771419ccd1f99852bc89159 — committed to zzzeek/alembic by zzzeek 6 years ago
- Pin pytest *before* 3.9.1 totally Unfortunately they have released 3.9.2 before fixing issue 4181, which means we will have to re-pin a third time after they eventually release with a fix Change-Id:... — committed to zzzeek/sqlalchemy by zzzeek 6 years ago
- block all py.test 3.9.1 or greater until https://github.com/pytest-dev/pytest/issues/4181 is fixed Change-Id: I867e2b36122f578e69f2444ef9712cd73995cce3 — committed to zzzeek/alembic by zzzeek 6 years ago
- Update pytest to 3.9.3 (#16) This PR updates [pytest](https://pypi.org/project/pytest) from **3.9.2** to **3.9.3**. <details> <summary>Changelog</summary> ### 3.9.3 ``` ... — committed to proof-media/rchain-grpc by pyup-bot 6 years ago
- Update pytest to 3.9.3 (#400) This PR updates [pytest](https://pypi.org/project/pytest) from **3.9.2** to **3.9.3**. <details> <summary>Changelog</summary> ### 3.9.3 ``` ... — committed to peterbe/django-peterbecom by pyup-bot 6 years ago
- Merge #43 43: Update pytest to 3.9.3 r=rehandalal a=pyup-bot This PR updates [pytest](https://pypi.org/project/pytest) from **3.8.2** to **3.9.3**. <details> <summary>Changelog</summary> ... — committed to rehandalal/therapist by bors[bot] 6 years ago
- Merge #1605 1605: Scheduled weekly dependency update for week 43 r=peterbe a=pyup-bot ### Update [botocore](https://pypi.org/project/botocore) from **1.12.28** to **1.12.33**. <details> <su... — committed to mozilla/normandy by bors[bot] 6 years ago
- Update pytest to 3.9.3 (#1273) This PR updates [pytest](https://pypi.org/project/pytest) from **3.9.2** to **3.9.3**. <details> <summary>Changelog</summary> ### 3.9.3 ``` ... — committed to mozilla-services/tecken by pyup-bot 6 years ago
- Scheduled weekly dependency update for week 52 (#75) ### Update [sphinx](https://pypi.org/project/sphinx) from **1.7.8** to **1.8.3**. <details> <summary>Changelog</summary> ... — committed to wdv4758h/python-everywhere by pyup-bot 5 years ago
- block py.test 3.9.1 references: https://github.com/pytest-dev/pytest/issues/4181 Change-Id: Iad3b6845e94753c55771419ccd1f99852bc89159 — committed to vvvrrooomm/alembic by zzzeek 6 years ago
- block all py.test 3.9.1 or greater until https://github.com/pytest-dev/pytest/issues/4181 is fixed Change-Id: I867e2b36122f578e69f2444ef9712cd73995cce3 — committed to vvvrrooomm/alembic by zzzeek 6 years ago
New occurrence of the same issue. Opened a separate issue since this was already resolved: https://github.com/pytest-dev/pytest/issues/5456
@otrejoso is definitely related, but is blowing up in a different place now it seems. Could you please open a new issue? Thanks!