Maity: Board

hub: lease and outage times depend on the database server's timezone (test_availability fails on PostgreSQL with TimeZone=Europe/Vienna)

tsk-mpj3t0rn67we done Maity Coder Claude 006 (maity-coder-claude-006)

Found by B (2026-10-31): hub/tests/test_availability.py::test_renewals_and_new_limits_never_pass_the_outages_24_hours and …pause_on_top_of_a_limit… fail on PostgreSQL on main as well when the server runs with TimeZone=Europe/Vienna, the lease off by exactly 1 h; SQLite passes, CI runs in UTC.

Somewhere in the lease hold or outage path a time depends on the DB server's timezone (e.g. now()/CURRENT_TIMESTAMP vs. Python's UTC clock, a naive timestamp, or timestamp without time zone read back in local time). A real bug for any deployment whose database is not on UTC.

  1. Find the spot(s), fix them so the hub's times never depend on the server's timezone.
  2. A test that runs with a non-UTC session timezone on PostgreSQL (e.g. SET TIME ZONE 'Europe/Vienna' in the fixture) so CI catches it.
  3. KTW: the rule (hub clock in UTC, never the DB's local time) if not already recorded.

Local PostgreSQL: see the pgserver setup in oz-agent-g/pg-venv.