244 lines
13 KiB
Plaintext
244 lines
13 KiB
Plaintext
date: 2026-11-06T09:52:20Z commit: 1a171d0d0f13ab71661a0f63e695031addd88dc0
|
|
environment: {"COMPOSE_PROJECT_NAME": "mtusi2026lab6", "LB_HTTP_PORT": "18086", "LB_STATS_PORT": "26085", "BASE_URL": "http://127.0.0.1:18086", "NO_PROXY": "localhost,127.0.0.1,::1"}
|
|
$ make student-test
|
|
.venv/bin/pytest
|
|
============================= test session starts ==============================
|
|
platform darwin -- Python 3.14.5, pytest-9.1.1, pluggy-1.6.0
|
|
rootdir: <repo>
|
|
configfile: pyproject.toml
|
|
testpaths: student-tests
|
|
plugins: asyncio-1.4.0, anyio-4.15.1
|
|
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
|
|
collected 536 items / 19 deselected / 517 selected
|
|
|
|
student-tests/adapters/test_rabbitmq.py .... [ 0%]
|
|
student-tests/adapters/test_s3_storage.py ... [ 1%]
|
|
student-tests/api/test_access.py ......... [ 3%]
|
|
student-tests/api/test_attachments.py .................................. [ 9%]
|
|
.... [ 10%]
|
|
student-tests/api/test_bounded_contexts.py ......F............. [ 14%]
|
|
student-tests/api/test_cache.py ...... [ 15%]
|
|
student-tests/api/test_concurrency.py .... [ 16%]
|
|
student-tests/api/test_consistency.py ........ [ 17%]
|
|
student-tests/api/test_drain.py .. [ 18%]
|
|
student-tests/api/test_events.py ...... [ 19%]
|
|
student-tests/api/test_http_telemetry.py . [ 19%]
|
|
student-tests/api/test_idempotency.py ............... [ 22%]
|
|
student-tests/api/test_instance.py .... [ 23%]
|
|
student-tests/api/test_job_returning.py . [ 23%]
|
|
student-tests/api/test_message_attachments.py ............. [ 25%]
|
|
student-tests/api/test_migrations.py ................................... [ 32%]
|
|
. [ 32%]
|
|
student-tests/api/test_negative.py ..................................... [ 40%]
|
|
[ 40%]
|
|
student-tests/api/test_operability.py .............. [ 42%]
|
|
student-tests/api/test_pagination.py .................. [ 46%]
|
|
student-tests/api/test_pipeline.py ............. [ 48%]
|
|
student-tests/api/test_pool.py ..F......... [ 51%]
|
|
student-tests/api/test_reconciler.py .........F. [ 53%]
|
|
student-tests/api/test_recovery.py ............ [ 55%]
|
|
student-tests/api/test_sessions.py .................. [ 58%]
|
|
student-tests/api/test_timeout.py ........ [ 60%]
|
|
student-tests/api/test_trace_context.py . [ 60%]
|
|
student-tests/api/test_upload_consistency.py ......... [ 62%]
|
|
student-tests/api/test_versioned_pipeline.py ........... [ 64%]
|
|
student-tests/api/test_wire_format.py .. [ 64%]
|
|
student-tests/unit/test_attachments_domain.py .......................... [ 70%]
|
|
. [ 70%]
|
|
student-tests/unit/test_authentication.py ..................... [ 74%]
|
|
student-tests/unit/test_cursor.py ........... [ 76%]
|
|
student-tests/unit/test_domain.py ...................................... [ 83%]
|
|
.. [ 84%]
|
|
student-tests/unit/test_job_observer.py . [ 84%]
|
|
student-tests/unit/test_pipeline_domain.py ....................... [ 88%]
|
|
student-tests/unit/test_probe.py .............. [ 91%]
|
|
student-tests/unit/test_reconcile_measurements.py ...... [ 92%]
|
|
student-tests/unit/test_render_pool.py .....s. [ 94%]
|
|
student-tests/unit/test_renderer.py .................... [ 97%]
|
|
student-tests/unit/test_scaling.py ..... [ 98%]
|
|
student-tests/unit/test_telemetry_platform.py ..... [ 99%]
|
|
student-tests/unit/test_timeouts.py . [100%]
|
|
|
|
=================================== FAILURES ===================================
|
|
_____________________ test_shared_core_holds_only_platform _____________________
|
|
|
|
def test_shared_core_holds_only_platform() -> None:
|
|
names = {
|
|
path.name
|
|
for layer in ("domain", "application", "infrastructure")
|
|
for path in modules_under("shared", layer)
|
|
}
|
|
> assert names == {
|
|
"errors.py",
|
|
"events.py",
|
|
"commands.py",
|
|
"messagebus.py",
|
|
"ports.py",
|
|
"clock.py",
|
|
"ids.py",
|
|
"logging.py",
|
|
"postgres.py",
|
|
"telemetry.py",
|
|
"readiness.py",
|
|
}
|
|
E AssertionError: assert {'clock.py', ...ging.py', ...} == {'clock.py', ...ging.py', ...}
|
|
E
|
|
E Extra items in the left set:
|
|
E 'trace_context.py'
|
|
E 'runtime_metrics.py'
|
|
E Use -v to get more diff
|
|
|
|
student-tests/api/test_bounded_contexts.py:104: AssertionError
|
|
________________ test_idle_session_does_not_acquire_connection _________________
|
|
|
|
self = <messenger.shared.infrastructure.postgres.Database object at 0x32428de00>
|
|
|
|
@asynccontextmanager
|
|
async def session(self) -> AsyncIterator[DatabaseSession]:
|
|
try:
|
|
async with self._sessions() as session:
|
|
self._waiting += 1
|
|
try:
|
|
> await session.connection()
|
|
|
|
src/messenger/shared/infrastructure/postgres.py:106:
|
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/ext/asyncio/session.py:930: in connection
|
|
sync_connection = await greenlet_spawn(
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/util/_concurrency_py3k.py:201: in greenlet_spawn
|
|
result = context.throw(*sys.exc_info())
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/orm/session.py:2092: in connection
|
|
return self._connection_for_bind(
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/orm/session.py:2108: in _connection_for_bind
|
|
return trans._connection_for_bind(engine, execution_options)
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/orm/state_changes.py:137: in _go
|
|
ret_value = fn(self, *arg, **kw)
|
|
^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/orm/session.py:1187: in _connection_for_bind
|
|
conn = bind.connect()
|
|
^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:3285: in connect
|
|
return self._connection_cls(self)
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:143: in __init__
|
|
self._dbapi_connection = engine.raw_connection()
|
|
^^^^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/engine/base.py:3309: in raw_connection
|
|
return self.pool.connect()
|
|
^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/pool/base.py:447: in connect
|
|
return _ConnectionFairy._checkout(self)
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/pool/base.py:1264: in _checkout
|
|
fairy = _ConnectionRecord.checkout(pool)
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/pool/base.py:711: in checkout
|
|
rec = pool._do_get()
|
|
^^^^^^^^^^^^^^
|
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
|
self = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x324289390>
|
|
|
|
def _do_get(self) -> ConnectionPoolEntry:
|
|
use_overflow = self._max_overflow > -1
|
|
|
|
wait = use_overflow and self._overflow >= self._max_overflow
|
|
try:
|
|
return self._pool.get(wait, self._timeout)
|
|
except sqla_queue.Empty:
|
|
# don't do things inside of "except Empty", because when we say
|
|
# we timed out or can't connect and raise, Python 3 tells
|
|
# people the real error is queue.Empty which it isn't.
|
|
pass
|
|
if use_overflow and self._overflow >= self._max_overflow:
|
|
if not wait:
|
|
return self._do_get()
|
|
else:
|
|
> raise exc.TimeoutError(
|
|
"QueuePool limit of size %d overflow %d reached, "
|
|
"connection timed out, timeout %0.2f"
|
|
% (self.size(), self.overflow(), self._timeout),
|
|
code="3o7r",
|
|
)
|
|
E sqlalchemy.exc.TimeoutError: QueuePool limit of size 1 overflow 0 reached, connection timed out, timeout 1.00 (Background on this error at: https://sqlalche.me/e/20/3o7r)
|
|
|
|
.venv/lib/python3.14/site-packages/sqlalchemy/pool/impl.py:166: TimeoutError
|
|
|
|
The above exception was the direct cause of the following exception:
|
|
|
|
async def test_idle_session_does_not_acquire_connection() -> None:
|
|
async with running_app(db_pool_max_size=1) as http:
|
|
database = await resolve(http, Database)
|
|
> async with database.session(), database.session() as active:
|
|
^^^^^^^^^^^^^^^^^^
|
|
|
|
student-tests/api/test_pool.py:74:
|
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
../../../../../.local/share/uv/python/cpython-3.14.5-macos-aarch64-none/lib/python3.14/contextlib.py:214: in __aenter__
|
|
return await anext(self.gen)
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
|
|
self = <messenger.shared.infrastructure.postgres.Database object at 0x32428de00>
|
|
|
|
@asynccontextmanager
|
|
async def session(self) -> AsyncIterator[DatabaseSession]:
|
|
try:
|
|
async with self._sessions() as session:
|
|
self._waiting += 1
|
|
try:
|
|
await session.connection()
|
|
finally:
|
|
self._waiting -= 1
|
|
yield session
|
|
except Exception as error:
|
|
if not unavailable(error):
|
|
raise
|
|
> raise Unavailable("PostgreSQL недоступен") from error
|
|
E messenger.shared.application.errors.Unavailable: PostgreSQL недоступен
|
|
|
|
src/messenger/shared/infrastructure/postgres.py:113: Unavailable
|
|
_______________ test_cancelled_pass_releases_its_autocommit_lock _______________
|
|
|
|
dsn = 'postgresql://postgres:test@127.0.0.1:26002/reconcile_07e983d849c3'
|
|
|
|
async def test_cancelled_pass_releases_its_autocommit_lock(dsn: str) -> None:
|
|
async with stand(dsn) as s:
|
|
entered = asyncio.Event()
|
|
|
|
async def hold() -> None:
|
|
async with PostgresSingleRun(s.database, LOCK_KEY).hold() as held:
|
|
assert held
|
|
entered.set()
|
|
await asyncio.Event().wait()
|
|
|
|
task = asyncio.create_task(hold())
|
|
try:
|
|
await asyncio.wait_for(entered.wait(), 2)
|
|
states = await s.sql(
|
|
"SELECT a.state FROM pg_locks l JOIN pg_stat_activity a ON a.pid = l.pid "
|
|
"WHERE l.locktype = 'advisory' AND l.objid = $1",
|
|
LOCK_KEY,
|
|
)
|
|
> assert [row["state"] for row in states] == ["idle"]
|
|
E AssertionError: assert ['idle in transaction'] == ['idle']
|
|
E
|
|
E At index 0 diff: 'idle in transaction' != 'idle'
|
|
E Use -v to get more diff
|
|
|
|
student-tests/api/test_reconciler.py:403: AssertionError
|
|
=============================== warnings summary ===============================
|
|
student-tests/api/test_reconciler.py: 11 warnings
|
|
<sys>:0: SAWarning: Connection is already established for the given bind; execution_options ignored
|
|
|
|
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
|
|
=========================== short test summary info ============================
|
|
FAILED student-tests/api/test_bounded_contexts.py::test_shared_core_holds_only_platform
|
|
FAILED student-tests/api/test_pool.py::test_idle_session_does_not_acquire_connection
|
|
FAILED student-tests/api/test_reconciler.py::test_cancelled_pass_releases_its_autocommit_lock
|
|
= 3 failed, 513 passed, 1 skipped, 19 deselected, 11 warnings in 156.67s (0:02:36) =
|
|
make: *** [student-test] Error 1
|
|
exit_code: 2 elapsed_seconds: 159.760
|