Tombstoning #1294
GitHub Actions / JUnit Test Report
failed
Jul 10, 2024 in 0s
1276 tests run, 1273 passed, 1 skipped, 2 failed.
Annotations
Check failure on line 1 in TestUserNoUnixAccount
github-actions / JUnit Test Report
TestUserNoUnixAccount.test_create_unix_account
sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "unix_tombstone_login_hash_key"
DETAIL: Key (login_hash)=(\xd342c0cad4f91ce12282458a36a5785c5536ba9424a3212a6650f035ec4ef1c0b75cfb63dbbb93588ddd058e960d2fa61a1bdf4058031555fb9418b4908d161f) already exists.
CONTEXT: SQL statement "update unix_tombstone ts set login_hash = v_u_login_hash where ts.uid = v_ua_ts.uid"
PL/pgSQL function user_ensure_tombstone() line 28 at SQL statement
[SQL: UPDATE "user" SET unix_account_id=%(unix_account_id)s WHERE "user".id = %(user_id)s]
[parameters: {'unix_account_id': 20, 'user_id': 215}]
(Background on this error at: https://sqlalche.me/e/20/gkpj)
Raw output
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:1971: in _exec_single_context
self.dialect.do_execute(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py:919: in do_execute
cursor.execute(statement, parameters)
E psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "unix_tombstone_login_hash_key"
E DETAIL: Key (login_hash)=(\xd342c0cad4f91ce12282458a36a5785c5536ba9424a3212a6650f035ec4ef1c0b75cfb63dbbb93588ddd058e960d2fa61a1bdf4058031555fb9418b4908d161f) already exists.
E CONTEXT: SQL statement "update unix_tombstone ts set login_hash = v_u_login_hash where ts.uid = v_ua_ts.uid"
E PL/pgSQL function user_ensure_tombstone() line 28 at SQL statement
The above exception was the direct cause of the following exception:
tests/model/test_unix_tombstone.py:200: in test_create_unix_account
with session.begin_nested():
../venv/lib/python3.11/site-packages/sqlalchemy/engine/util.py:147: in __exit__
with util.safe_reraise():
../venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py:146: in __exit__
raise exc_value.with_traceback(exc_tb)
../venv/lib/python3.11/site-packages/sqlalchemy/engine/util.py:145: in __exit__
self.commit()
<string>:2: in commit
???
../venv/lib/python3.11/site-packages/sqlalchemy/orm/state_changes.py:139: in _go
ret_value = fn(self, *arg, **kw)
../venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py:1257: in commit
self._prepare_impl()
<string>:2: in _prepare_impl
???
../venv/lib/python3.11/site-packages/sqlalchemy/orm/state_changes.py:139: in _go
ret_value = fn(self, *arg, **kw)
../venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py:1232: in _prepare_impl
self.session.flush()
../venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py:4296: in flush
self._flush(objects)
../venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py:4431: in _flush
with util.safe_reraise():
../venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py:146: in __exit__
raise exc_value.with_traceback(exc_tb)
../venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py:4392: in _flush
flush_context.execute()
../venv/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py:466: in execute
rec.execute(self)
../venv/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py:642: in execute
util.preloaded.orm_persistence.save_obj(
../venv/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py:85: in save_obj
_emit_update_statements(
../venv/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py:912: in _emit_update_statements
c = connection.execute(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:1422: in execute
return meth(
../venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py:514: in _execute_on_connection
return connection._execute_clauseelement(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:1644: in _execute_clauseelement
ret = self._execute_context(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:1850: in _execute_context
return self._exec_single_context(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:1990: in _exec_single_context
self._handle_dbapi_exception(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:2357: in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
../venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py:1971: in _exec_single_context
self.dialect.do_execute(
../venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py:919: in do_execute
cursor.execute(statement, parameters)
E sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "unix_tombstone_login_hash_key"
E DETAIL: Key (login_hash)=(\xd342c0cad4f91ce12282458a36a5785c5536ba9424a3212a6650f035ec4ef1c0b75cfb63dbbb93588ddd058e960d2fa61a1bdf4058031555fb9418b4908d161f) already exists.
E CONTEXT: SQL statement "update unix_tombstone ts set login_hash = v_u_login_hash where ts.uid = v_ua_ts.uid"
E PL/pgSQL function user_ensure_tombstone() line 28 at SQL statement
E
E [SQL: UPDATE "user" SET unix_account_id=%(unix_account_id)s WHERE "user".id = %(user_id)s]
E [parameters: {'unix_account_id': 20, 'user_id': 215}]
E (Background on this error at: https://sqlalche.me/e/20/gkpj)
Check failure on line 1 in TestUnixAccountNoUser
github-actions / JUnit Test Report
TestUnixAccountNoUser.test_create_user
failed on setup with "file /opt/pycroft/app/tests/model/test_unix_tombstone.py, line 213
def test_create_user(self, session, ua):
E fixture 'ua' not found
> available fixtures: _session_faker, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, class_session, clean_engine, connection, cov, doctest_namespace, engine, faker, module_session, module_transaction, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, session, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unix_account, utcnow
> use 'pytest --fixtures [testpath]' for help on them.
/opt/pycroft/app/tests/model/test_unix_tombstone.py:213"
Raw output
file /opt/pycroft/app/tests/model/test_unix_tombstone.py, line 213
def test_create_user(self, session, ua):
E fixture 'ua' not found
> available fixtures: _session_faker, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, class_session, clean_engine, connection, cov, doctest_namespace, engine, faker, module_session, module_transaction, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, session, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, unix_account, utcnow
> use 'pytest --fixtures [testpath]' for help on them.
/opt/pycroft/app/tests/model/test_unix_tombstone.py:213
Loading