Data UI Backlog

Load and concurrence test

A few simulated people ("wanderers") browsing one Data UI app in real Chrome while a real person browses it too. It was built to exercise the interim request-serialization gate by hand: real clicks on the real frontend produce the frontend's real traffic pattern, which is what the gate has to serve.

The script lives in the repo at scripts/crowd/crowd.mjs (with package.json and package-lock.json beside it, one dependency, playwright-core, pinned). Install once with npm ci --prefix scripts/crowd, run from the repo root with scripts/crowd/crowd.mjs --user NAME [--creds FILE]. Reference: docs/cli.md → crowd.mjs; options: --help.

What it does: opens one Chrome, one browser context per wanderer, signs in once through the app's own login form and hands the stored session to the others (one account, one login: the server keeps one refresh token per account). Each wanderer walks the real UI with lognormal human pauses: type tabs, paging, column sorts, opening rows and the notes beneath them, search typed character by character and cleared, chip filters, Home, Back / Forward, the odd reload. With --updates it also opens an item, clicks Edit, and replaces any leading [NNNN] in the title with a fresh one. Every request is logged with status and latency; each run writes report.txt, requests.jsonl, anomalies.jsonl, updates.jsonl and up to eight screenshots under scripts/crowd/runs/, which git and the Docker build ignore. Exit status 0 for a clean run, 1 when something went wrong, 2 for a setup error.

Verified so far, all against the development image with the gate code loaded: one and five wanderers as guest (reads only, hundreds of requests, all 200), and title updates through the real form as an account with update rights (POST /api/update p50 about 630 ms). Three false alarms in the harness itself were found and fixed (a journal-entry expand that sends no request, Back past the app's first page, and a row click landing on a chip). The full test gate passed after the move into the repo (4,378 checks across 66 groups).

Still open: the hang, HTTP-error and failed-update detectors have only ever been fired by harness false alarms, never by a real fault; runs past about 55 minutes break the shared session (each re-login retires the others' refresh token); page and console errors are reported but not counted in the verdict; there are no automated tests for the script itself; and the untested --hold-on-hang path is the way to inspect the server while a hung request is still open.

Related items: "Interim request serialization" (the gate this exercises, 50 Code Complete) and "Deadlock under concurrent requests" (the real fix, which retires the gate).

Slot
7182
Status
60 Done
Tags
mvp, concurrency, scripts, testing
Contributors
Donnie, Sofia