date: 2026-11-05T18:52:07.642995+00:00  commit: 18de59574016564ce4eb69da9f4363441ba33f7d
working_tree: added regression test in student-tests/api/test_pool.py; application code unchanged
environment: COMPOSE_PROJECT_NAME=mtusi2026lab3-grade3-20261105 LB_HTTP_PORT=18083 LB_STATS_PORT=23083 API_REPLICAS=2 NO_PROXY=localhost,127.0.0.1,::1
$ make student-test 'PYTEST_ARGS=-q -k closed_idle_connection'
.venv/bin/pytest -q -k closed_idle_connection
F                                                                        [100%]
=================================== FAILURES ===================================
_________ test_closed_idle_connection_is_replaced_before_registration __________

    async def test_closed_idle_connection_is_replaced_before_registration() -> None:
        async with running_app(db_pool_max_size=1) as http:
            database = await resolve(http, Database)
            async with database.session() as session:
                pid = await session.scalar(select(func.pg_backend_pid()))
            async with sql_connection() as connection:
                assert await connection.scalar(select(func.pg_terminate_backend(pid, 1000)))
            body = new_user("reconnect")
            response = await http.post("/api/v1/users", json=body)
>           assert response.status_code == 201
E           assert 503 == 201
E            +  where 503 = <Response [503 Service Unavailable]>.status_code

student-tests/api/test_pool.py:78: AssertionError
=========================== short test summary info ============================
FAILED student-tests/api/test_pool.py::test_closed_idle_connection_is_replaced_before_registration
1 failed, 282 deselected in 1.84s
make: *** [student-test] Error 1

exit_code: 2 elapsed_seconds: 2.461
