Skip to content

e2e: split drafts.spec.ts and optimize dev Argon2id hashing - #239

Merged
TusanHomichi merged 1 commit into
mainfrom
issue-199-drafts-e2e-timeout
Nov 20, 2026
Merged

TusanHomichi merged 1 commit into
mainfrom
issue-199-drafts-e2e-timeout

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

Primary Issue

Closes #199

Problem And Outcome

e2e/drafts.spec.ts:113 ran the entire daily-evaluation, review, finalization, export, trainee acknowledgment, packet, amendment, task signoff, and weekly summary lifecycle in one 385-line test performing 17 Argon2id hashes/verifies against an unoptimized debug binary. Even solo with 1 worker on this host it took 59.1s against the 60s test timeout, and under parallel suite load both drafts.spec.ts and unrelated /reset//login assertions in other specs tripped timeouts because unoptimized debug argon2/blake2 is ~30–50× slower than release.

Splitting drafts.spec.ts into four focused lifecycle tests (reusing per-role browser contexts and preserving every existing assertion) and compiling argon2 and blake2 at opt-level = 3 in dev/test builds brings the four tests to 4.7s–20.5s inside the full parallel suite and cuts full local E2E runtime from 16.5m to 4.6m without changing any Argon2id parameters or raising any timeouts.

Changes

  • Cargo.toml
    • Added [profile.dev.package.argon2] and [profile.dev.package.blake2] with opt-level = 3 so dev/test password hashing runs at realistic release speed while keeping every Argon2id parameter (m=19456, t=2, p=1) unchanged.
  • web/e2e/drafts.spec.ts
    • Split the single 385-line test into four focused lifecycle tests with shared seeding helpers and per-role browser contexts (openSignedInContext), keeping all existing assertions intact:
      1. draft, collaborate, transfer, and submit a daily evaluation
      2. review, request changes, approve, finalize, and export a daily evaluation
      3. trainee acknowledges a finalized record, downloads a verified packet, and re-acknowledges an amendment
      4. coordinator signs off tasks with override reasons and links a finalized daily version into a weekly summary

Verification

Baseline (before fix)

  • Solo run on unfixed main: npx playwright test e2e/drafts.spec.ts → 59.1s (0.9s under the 60s timeout).
  • Full cargo xtask proof prior run on loaded host: drafts.spec.ts exceeded 60s timeout (npm run e2e took 663–995s).

Stress check (after split, before opt-level = 3)

  • npx playwright test e2e/drafts.spec.ts --repeat-each=3 → 12/12 passed across 3 parallel workers (24.4s–46.4s).

After split + dev argon2/blake2 optimization (inside full parallel E2E suite)

  • draft, collaborate, transfer, and submit a daily evaluation: 20.5s
  • review, request changes, approve, finalize, and export a daily evaluation: 11.9s
  • trainee acknowledges a finalized record, downloads a verified packet, and re-acknowledges an amendment: 7.5s
  • coordinator signs off tasks with override reasons and links a finalized daily version into a weekly summary: 4.7s

Local proof receipt — passed

  • Candidate: d71b3f6ca7acf6c67a4a027bb255363978fddad6 tree 9505744eb3386801fbd19b8a23690f970c47666b; unchanged during run: true
  • Scope: local (local run; hosted pr-gate results are separate evidence, linked not copied)
  • Command: cargo xtask proof in /data/dev/src/consolebook
  • Started 2026-11-20T17:03:30Z, finished 2026-11-20T17:12:39Z, 547.8s
  • Sequence source: CONTRIBUTING.md sha256 87f297e8dad4868f1364b29eb9a45b372ca3dc34e8e205c3505d15883036daa5
  • Browser: playwright-managed /home/dev/.cache/ms-playwright/chromium-1254/chrome-linux64/chrome (Google Chrome for Testing 158.0.8127.18)
  • Host: Linux-6.18.64-x86_64; euid 1001; can bypass file permissions: false (from CapEff)
  • Toolchain: rustc 1.99.1 (58cf8f9c3 2026-10-13); node v22.23.5; npm 10.9.9
  • Binary: target/debug/consolebook-server sha256 4a53968554a2918a81253efff6b5dc7caf4b4aa0a69f1a44bc3ea00ec6ca2015
  • Web build manifest: 54 files, sha256 a3575deff4d79ac07b095b00051459728cc0ad0ad1fa11543ee4af9230faf38c
  • Browser suite: 74 expected, 0 unexpected, 0 flaky, 0 skipped; report sha256 5d0bd902590fe37b5e4a8fb552805d76fe4fc2518a1d11ddb113bfdf59c9d179
# Command Status Exit Seconds Log sha256 (prefix)
1 scripts/check-guidance-names.sh passed 0 0.185 01.log 2b172a8e66c87574
2 (cd web && npm ci && npm run check && npm run build) passed 0 44.16 02.log 1d6925722aee3334
3 cargo fmt --check passed 0 1.765 03.log e3b0c44298fc1c14
4 cargo clippy --workspace --all-targets -- -D warnings passed 0 30.595 04.log 149fdeeeff2df10f
5 cargo test --workspace passed 0 188.801 05.log 63ff7654a72956d5
6 cargo build -p consolebook-server passed 0 0.892 06.log 29b5eb7e6828fd2e
7 (cd web && npx playwright install chromium && npm run e2e) passed 0 281.386 07.log a1b6bbf163d018be

Review And Merge Notes

  • Correction ladder rung: Rung 1 (Codebase) — fixed both the oversized test structure (drafts.spec.ts) and the underlying debug-build Argon2id bottleneck in Cargo.toml without touching security parameters or global timeouts.
  • All fixtures are invented; no production runtime behavior or schema changed.

Split the 385-line single test in web/e2e/drafts.spec.ts (17 debug Argon2id hashes/verifies, 59.1s solo against the 60s budget) into four focused lifecycle tests reusing signed-in per-role browser contexts while preserving every assertion, and compile argon2 and blake2 at opt-level = 3 in dev/test builds so test sign-in/reset flows run at realistic Argon2id speed instead of unoptimized debug speed without changing any Argon2id parameters or raising timeouts.

Closes #199
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T17:15:26.912880Z d71b3f6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@fieldmouseworks-steward fieldmouseworks-steward Bot added the waiting: review Its reviewers, or a Claude job judging it, are looking at this head label Nov 20, 2026
@TusanHomichi TusanHomichi changed the title test(e2e): split drafts.spec.ts and optimize dev Argon2id hashing e2e: split drafts.spec.ts and optimize dev Argon2id hashing Nov 20, 2026
@TusanHomichi
TusanHomichi merged commit 6a2e1be into main Nov 20, 2026
25 of 26 checks passed
@TusanHomichi
TusanHomichi deleted the issue-199-drafts-e2e-timeout branch November 20, 2026 17:36
@fieldmouseworks-steward fieldmouseworks-steward Bot removed the waiting: review Its reviewers, or a Claude job judging it, are looking at this head label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(e2e): drafts.spec.ts daily-evaluation flow exceeds its 60s timeout under host load

1 participant