From a6ae1fb8f27c07df2e8df1e3b268279dc8834805 Mon Sep 17 00:00:00 2001 From: Musa Kaleem <131704022+Musa-Kal@users.noreply.github.com> Date: Fri, 13 Nov 2026 20:14:38 -0500 Subject: [PATCH 1/2] ci: raise the local realtime event limit for e2e Parallel journeys pass the local tenant's 100 Postgres change messages a second, and Realtime drops the rest, so live updates went missing at random. Co-authored-by: Ferrin <177692050+Ferrin-Y@users.noreply.github.com> Co-authored-by: noorelmosrati <182049385+noorelmosrati@users.noreply.github.com> --- .github/workflows/ci.yml | 16 ++++++++++++++-- docs/testing.md | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 214e293..67a6c96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,10 +88,22 @@ jobs: supabase status -o env | grep -E '^(API_URL|PUBLISHABLE_KEY)=' > /tmp/sb.env . /tmp/sb.env printf 'VITE_SUPABASE_URL=%s\nVITE_SUPABASE_PUBLISHABLE_KEY=%s\nVITE_APP_URL=http://localhost:4173\n' "$API_URL" "$PUBLISHABLE_KEY" > .env.local + # The local Realtime tenant allows 100 Postgres change messages a second and drops the rest + # (MessagePerSecondRateLimitReached), which parallel journeys pass. Raise it, then restart + # Realtime so it rereads the tenant. + - name: Raise Realtime limits + run: | + docker exec supabase_db_potluck psql -U postgres -v ON_ERROR_STOP=1 -c "update _realtime.tenants set max_events_per_second = 1000, max_joins_per_second = 500 where external_id = 'realtime-dev'" + docker restart supabase_realtime_potluck + for i in $(seq 1 30); do + [ "$(docker inspect -f '{{.State.Health.Status}}' supabase_realtime_potluck)" = healthy ] && break + sleep 2 + done + docker inspect -f '{{.State.Health.Status}}' supabase_realtime_potluck - run: pnpm --filter @potluck/web exec playwright install --with-deps chromium webkit - run: pnpm e2e - # Live updates are silent when Realtime drops a change (a policy that errors or times out - # for the subscriber), so keep its log when a journey fails. + # Live updates are silent when Realtime drops a change (a rate limit, or a policy that errors + # or times out for the subscriber), so keep its log when a journey fails. - name: Realtime log if: failure() run: docker logs supabase_realtime_potluck 2>&1 | tail -n 400 diff --git a/docs/testing.md b/docs/testing.md index 1ad7494..371cb58 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -130,7 +130,7 @@ pnpm --filter @potluck/web exec playwright test e2e/expenses.spec.ts --project=d pnpm --filter @potluck/web exec playwright show-report # after a failure ``` -Locally, a server already listening on :4173 is reused, even if another checkout or worktree started it, so the tests may run another branch's build. If you change app code while one is running, rebuild with `VITE_APP_URL=http://localhost:4173 pnpm --filter @potluck/web build` or stop it first. `E2E_PORT=4174` runs on another port beside it. `E2E_WORKERS` sets the local worker count (default 2). +Locally, a server already listening on :4173 is reused, even if another checkout or worktree started it, so the tests may run another branch's build. If you change app code while one is running, rebuild with `VITE_APP_URL=http://localhost:4173 pnpm --filter @potluck/web build` or stop it first. `E2E_PORT=4174` runs on another port beside it. `E2E_WORKERS` sets the local worker count (default 2). The local Realtime tenant drops Postgres changes past 100 a second (`MessagePerSecondRateLimitReached` in `docker logs supabase_realtime_potluck`), which looks like a live update that never arrives. CI raises it in the e2e job; locally, run the same `update _realtime.tenants` from `ci.yml` and restart the Realtime container if live journeys fail only under load. Projects (`apps/web/playwright.config.ts`): From a18d7d6496162e7c5d44525b974ab59c00fd1ec2 Mon Sep 17 00:00:00 2001 From: Musa Kaleem <131704022+Musa-Kal@users.noreply.github.com> Date: Fri, 13 Nov 2026 20:19:22 -0500 Subject: [PATCH 2/2] ci: update the realtime tenant as supabase_admin Co-authored-by: Ferrin <177692050+Ferrin-Y@users.noreply.github.com> Co-authored-by: noorelmosrati <182049385+noorelmosrati@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- docs/testing.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67a6c96..0cf6048 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: # Realtime so it rereads the tenant. - name: Raise Realtime limits run: | - docker exec supabase_db_potluck psql -U postgres -v ON_ERROR_STOP=1 -c "update _realtime.tenants set max_events_per_second = 1000, max_joins_per_second = 500 where external_id = 'realtime-dev'" + docker exec supabase_db_potluck psql -U supabase_admin -d postgres -v ON_ERROR_STOP=1 -c "update _realtime.tenants set max_events_per_second = 1000, max_joins_per_second = 500 where external_id = 'realtime-dev'" docker restart supabase_realtime_potluck for i in $(seq 1 30); do [ "$(docker inspect -f '{{.State.Health.Status}}' supabase_realtime_potluck)" = healthy ] && break diff --git a/docs/testing.md b/docs/testing.md index 371cb58..2a93b13 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -130,7 +130,7 @@ pnpm --filter @potluck/web exec playwright test e2e/expenses.spec.ts --project=d pnpm --filter @potluck/web exec playwright show-report # after a failure ``` -Locally, a server already listening on :4173 is reused, even if another checkout or worktree started it, so the tests may run another branch's build. If you change app code while one is running, rebuild with `VITE_APP_URL=http://localhost:4173 pnpm --filter @potluck/web build` or stop it first. `E2E_PORT=4174` runs on another port beside it. `E2E_WORKERS` sets the local worker count (default 2). The local Realtime tenant drops Postgres changes past 100 a second (`MessagePerSecondRateLimitReached` in `docker logs supabase_realtime_potluck`), which looks like a live update that never arrives. CI raises it in the e2e job; locally, run the same `update _realtime.tenants` from `ci.yml` and restart the Realtime container if live journeys fail only under load. +Locally, a server already listening on :4173 is reused, even if another checkout or worktree started it, so the tests may run another branch's build. If you change app code while one is running, rebuild with `VITE_APP_URL=http://localhost:4173 pnpm --filter @potluck/web build` or stop it first. `E2E_PORT=4174` runs on another port beside it. `E2E_WORKERS` sets the local worker count (default 2). The local Realtime tenant drops Postgres changes past 100 a second (`MessagePerSecondRateLimitReached` in `docker logs supabase_realtime_potluck`), which looks like a live update that never arrives. CI raises it in the e2e job; locally, run the same `update _realtime.tenants` from `ci.yml` (as `supabase_admin`; `postgres` may not write it) and restart the Realtime container if live journeys fail only under load. Projects (`apps/web/playwright.config.ts`):