Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ jobs:
. /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.
# (MessagePerSecondRateLimitReached), which parallel journeys pass. Realtime reseeds its
# tenant with those defaults when it starts (SEED_SELF_HOST), so restart it first and raise
# the limits after, before any client connects and caches the tenant.
- name: Raise Realtime limits
run: |
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
sleep 2
done
docker inspect -f '{{.State.Health.Status}}' supabase_realtime_potluck
docker exec supabase_db_potluck psql -U supabase_admin -d postgres -v ON_ERROR_STOP=1 -At -c "update _realtime.tenants set max_events_per_second = 1000, max_joins_per_second = 500 where external_id = 'realtime-dev' returning max_events_per_second"
- 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 rate limit, or a policy that errors
Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` (as `supabase_admin`; `postgres` may not write it) 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, restart the Realtime container (it reseeds the defaults when it starts) and then run the same `update _realtime.tenants` from `ci.yml` as `supabase_admin` (`postgres` may not write it), before opening the app.

Projects (`apps/web/playwright.config.ts`):

Expand Down
Loading