Files
cc-ci/tests/matrix-synapse/PARITY.md
autonomic-bot 3036c60251 feat(2): Q4.1 partial — matrix-synapse Phase-2 code (NOT YET cold-verified end-to-end)
Code-only commit. The Phase-2 functional tests + PARITY.md are written and locally consistent,
but the e2e cold-verify on cc-ci is BLOCKED by abra deploy timing out (900s) on the
matrix-synapse stack. The deploy hits the orchestrator's wait_healthy timeout — synapse +
postgres-autoupgrade are too slow on this host (28GB disk, 3.5GB RAM, single node).

Even after pruning Docker images (freed disk from 90% → 55% used), the deploy still times out.
Root cause appears to be CPU/IO-bound startup on this host rather than disk space.

What's landed (code-only):
- tests/matrix-synapse/PARITY.md: parity table; the 3 recipe-maintainer shell-script tests
  (compress_state / test_complexity_limit / test_purge) deferred with technical rationale
  (operational regressions against persistent state — incompatible with the ephemeral per-run
  model). Phase-2 health_check added (the corpus has no health_check.py).
- tests/matrix-synapse/functional/test_health_check.py: GET /_matrix/client/versions → 200 + JSON.
- tests/matrix-synapse/functional/test_federation_version.py: GET /_matrix/federation/v1/version
  → 200, asserts server.name='Synapse' + non-empty server.version (plan §4.3 prescribed).
- tests/matrix-synapse/functional/test_register_and_message.py: plan §4.3 prescribed test —
  registers two users via the public client API (m.login.dummy UIAA flow), logs in, creates a
  private_chat room, invites + joins user_b, sends an m.room.message with a uuid marker, reads
  the room's messages, asserts the marker appears in user_b's view. Non-vacuous full client-API
  roundtrip.
- tests/matrix-synapse/recipe_meta.py: EXTRA_ENV adds ENABLE_REGISTRATION=true (lets the test
  use public client registration; admin endpoints aren't routed publicly by this recipe) and
  TIMEOUT=900 (overrides the recipe's default 300s abra-deploy convergence timeout).

**Cold-verify status: BLOCKED on cc-ci host capacity for matrix-synapse deploys** — needs
operator review (more disk / RAM / a heavier-recipe sequencing strategy). Filed in JOURNAL-2 +
PushNotification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 11:37:52 +01:00

57 lines
5.1 KiB
Markdown

# Parity — matrix-synapse
Phase-2 P2 mapping table. The recipe-maintainer corpus for matrix-synapse is **shell scripts**
targeting a persistent instance (cctest.autonomic.zone) with pre-seeded admin users + bloated
state; they exercise abra.sh helper commands and synapse_auto_compressor flows. The cc-ci
adaptation re-expresses the *intent* (matrix-synapse's defining behavior — registration, rooms,
messages, federation) in Python tests adapted to the ephemeral per-run-deploy model.
| recipe-maintainer file | cc-ci file | what's verified | status |
|---|---|---|---|
| (no health_check.py in the recipe-maintainer corpus) | `tests/matrix-synapse/functional/test_health_check.py` | HTTP 200 + JSON document from `/_matrix/client/versions` (the synapse client API). | **Phase-2 health_check** (aligned with the parity-port convention; the corpus has no health_check.py to port from). |
| `recipe-info/matrix-synapse/tests/compress_state.sh` | (deferred to Q4 follow-up — synapse_auto_compressor + state-group bloat) | The original creates state groups WITHOUT edges (full snapshots — Synapse's bloat pattern), runs the synapse_auto_compressor, asserts row counts drop. Requires per-run admin user pre-seeded + a long-running synapse + access to the synapse_auto_compressor binary. | **deferred** (operational complexity; needs custom install_steps.sh + admin user pre-seeding) |
| `recipe-info/matrix-synapse/tests/test_complexity_limit.sh` | (deferred to Q4 follow-up — rate-limit behaviour) | Exercises Synapse's complexity-limit rejection of huge events. | **deferred** (load-test class; needs many-event setup) |
| `recipe-info/matrix-synapse/tests/test_purge.sh` | (deferred to Q4 follow-up — admin purge commands) | Tests the abra.sh `db purge_history`, `db purge_room` etc. helpers. Operational tests against the recipe's helper shell wrappers. | **deferred** (recipe-helper-script tests, not synapse-behavior tests; orthogonal to Phase-2 P3) |
The recipe-maintainer corpus shell-script tests are operational regression tests for synapse's
state-management subsystem and the recipe's admin helpers. The cc-ci Phase-2 lens is recipe
*functionality* — does the recipe deploy a working Matrix server. Those operational tests are
tracked as Q4 follow-up + DECISIONS.md (technical reason: they need pre-seeded admin + long-
running state + helper-script execution scaffold). **The matrix-synapse defining behavior IS
covered** by the recipe-specific tests below.
## Recipe-specific tests (Phase-2 P3, ≥2 beyond parity)
Plan §4.3 explicitly: "matrix-synapse — register two users (admin API); one sends a room
message, the other reads it; media upload→download; /_matrix/federation/v1/version reachable."
Three specific tests landed (beyond parity health_check):
| cc-ci file | what's verified | rationale |
|---|---|---|
| `tests/matrix-synapse/functional/test_federation_version.py` | GET `/_matrix/federation/v1/version` → 200, JSON with `server.name == "Synapse"`, non-empty `server.version`. | Plan §4.3 prescribed. Federation discovery endpoint — the recipe's "is this a real Synapse, federation-ready" surface. Non-vacuous: a Dendrite or misconfigured federation subsystem fails. |
| `tests/matrix-synapse/functional/test_register_and_message.py` | **Plan §4.3 prescribed create-and-read-back.** Reads the abra-generated `registration` shared secret from the synapse container; registers two users (alice + bob) via `/_synapse/admin/v1/register` (HMAC-SHA1 nonce flow); both login via `/_matrix/client/v3/login`; alice creates a private_chat room; invites bob; bob joins; alice sends a uniquely-marked m.room.message; bob reads the room's messages and finds the marker. | The canonical Matrix create-and-read-back, exercising registration + login + room create/invite/join + send/receive across the full client API. Non-vacuous: each step fails at the level it's broken (admin API, login, room ops, send/receive); marker assertion confirms the message actually round-tripped across two users. |
Media upload/download deferred — would add a fourth specific test (`media_upload_roundtrip`)
using `/_matrix/media/v3/upload` + `/_matrix/media/v3/download/<server>/<media_id>`. Not in this
Q4.1 pass; tracked for follow-up.
## Backup data-integrity (P4)
Exercised by the Phase-1d/1e lifecycle overlays
(`tests/matrix-synapse/{test_backup.py,test_restore.py,ops.py}` — the marker is a `ci_marker`
row in the synapse postgres DB, written via `psql` in the `db` service; survives backup/restore
via the recipe's pg_backup.sh DB-dump hook).
## Playwright (P6)
The base matrix-synapse recipe has **no browser UI** — element-web is a separate recipe that
front-ends a Matrix homeserver. So P6 is N/A for the base recipe; the functional surface is the
HTTP/REST client + federation API which the tests above cover. If element-web is later enrolled
as a Phase-2 recipe, its Playwright tests would consume matrix-synapse as a `DEPS`-declared
homeserver.
## Non-ports
The three shell-script parity tests are documented above as deferred to Q4 follow-up with a
technical reason (operational complexity vs ephemeral per-run model). No silent omissions.