Skip to content

test(psa): give the bulk-submit cases of hotcrm#2764 a measured budget (#2849) - #2854

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-2849-psa-approvals-timeout
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-2849-psa-approvals-timeout

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #2849

Metadata-impact: none (test-only: no file under src/ changes)
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感,只改了一份自动化测试的等待时限。
  • 为什么做:项目交付模块的报销提交测试在两个无关的拉取请求上超时,挡住了合并。
  • 出错会怎样:最坏只是这几条测试多等几秒才报错,产品行为不变,可直接撤回。
  • 要你做什么:无

What changes

test/psa-approvals.test.ts, describe "an expense report is not submitted on a locked, closed or cancelled project (hotcrm#2764)":

  • the four bulk-click cases (submit_for_reimbursement / submit_trip_for_reimbursement over a locked, closed or cancelled project) get their own 15 s budget, with the measured reading and the cause beside it, in the pattern of test/import-values-accepted.test.ts:90;
  • the "a Draft report on a locked project …" case beside them gets the same budget (same class: 3.2-4.4 s on CI shard 2, under 1 s from the default).

No assertion is changed, nothing is skipped, and the global testTimeout is untouched. The changeset is empty-frontmatter (test-only, nothing ships).

Tests

The cause, measured. The cases are heavy by construction, and were born close to the 5 s default:

  • each case takes two projects through initiation approval to Active, (trip) a travel request through its approval, then one click that writes and submits three reports, each starting its approval flow;
  • local phase profile of the trip case (instrumented scratch copy, not committed): project setups ~1.1-1.2 s, travel request ~0.2 s, click ~0.75-0.85 s, refused-report checks ~5 ms, and the vi.waitFor on the approval requests resolves on its first poll (1 ms) — no wait loop;
  • #2771's project task hook changed nothing: trip cases 2.14-2.40 s on ee9fccd9f (before it) vs 2.14-2.28 s on 142e7a17, same box, interleaved;
  • #2845 made these flows faster on CI (puts the expenses of each project: 2.9-3.1 s on d72de417 → 1.6-1.8 s on 332710e8);
  • the port to 19 (#2820) made the shared work 15-25 % slower locally (332710e8 18.6.0 vs c6e64eed 19.0.0-next.2: file tests 24.0-25.3 s → 28.7-29.0 s; is approved by a Project Director 517-535 → 644-711 ms) — platform side, already carried by automation: on 19.0.0-next.2, the run-history overflow prune warns "Record run_… not found in sys_automation_run" for rows it just counted (57 per test shard in hotcrm) objectstack#38303;
  • CI shard 2 history of the trip cases: 4.57/4.65 s on ee9fccd9f (the commit that added them), 3.69-4.15 s on 526f21c5, 4.05-4.97 s on 142e7a17, and failed at 5174/5211 ms (019931ca, job 141168379949) and 5426 ms (72326bed, job 141183406038). CI/local ratio ≈ 2.2-2.5×.
Local readings (`--maxWorkers=2`, shared box)
Run trip locked trip cancelled reimb. locked reimb. closed Draft on locked
142e7a17 full file ×3 2187 / 2143 / 2275 2198 / 2142 / 2217 1643 / 1684 / 1592 1813 / 1600 / 1890 1817 / 1779 / 1787
142e7a17 -t trip ×2 3077 / 2752 2474 / 2265 – – –
ee9fccd9f full file ×2 2141 / 2294 2169 / 2398 1663 / 1828 1658 / 1933 1802 / 2043
this head 04ae01b0 full file ×3 2237 / 2307 / 2230 2254 / 2236 / 2219 1680 / 1717 / 1648 1672 / 1757 / 1757 1885 / 1710 / 1810

Acceptance notes

Verification

Two-minute check: pnpm exec vitest run --maxWorkers=2 test/psa-approvals.test.ts — expect Tests 29 passed (29), the trip cases around 2.2 s locally.

Read first: test/psa-approvals.test.ts — the two }, 15_000); lines and the comment block above the bulk-click it.each.

Gates on 04ae01b0: pnpm validate exit 0 (✓ Validation passed), pnpm typecheck exit 0, pnpm lint exit 0 (54 suggestions, no errors), pnpm hygiene exit 0 (✓ source hygiene clean), psa file ×3 exit 0 (29/29 each, 49.5-50.1 s).

🤖 Generated with Claude Code

https://claude.ai/code/session_017xRBcV3h25dAMNWki8e1ns

The four bulk-click cases of test/psa-approvals.test.ts (and the locked
Draft report case beside them) each take two projects through initiation
approval, a travel request through its approval, and then one click that
writes and submits three reports. Locally they run 1.6-3.1 s; on CI shard 2
the trip cases ran 3.7-5.0 s on main and failed at 5174, 5211 and 5426 ms
on two unrelated PRs. Nothing waits on a loop (the approval-request wait
returns on its first poll) and the project task hook of #2771 changed
nothing (measured on ee9fccd), so the cases get their own 15 s budget
with the reading beside it, as test/import-values-accepted.test.ts does.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcV3h25dAMNWki8e1ns
@vercel

vercel Bot commented Nov 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Nov 29, 2026 3:36am UTC

Request Review

@github-actions github-actions Bot added the ci/cd CI plumbing and the verification pipeline label Nov 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:hotcrm#2 · sunhaolin · session_017xRBcV3h25dAMNWki8e1ns

维护者速读

  • 修掉了连续卡住三个 PR 的测试超时:项目被锁定或取消时提交报销单的那几条用例,本身就要走两次立项审批加一次出差审批,CI 上要 4.5 秒左右,离 5 秒上限太近。
  • 只给这 5 条用例单独放宽到 15 秒,旁边写明实测读数和原因;断言一条没改,全局超时没动。
  • 升到 19 后审批流程整体慢了约 15–20%,证据已补到平台卡 objectstack#38303。
  • 席位意见:可以落地。独立评审通过,CI 全绿。

席位核对 — ACCEPT · repo:hotcrm#2 · head 04ae01b

  1. Shape. 2 files: test/psa-approvals.test.ts (+22/−3) and an empty-frontmatter changeset (test-only, AGENTS.md:333). No governed path. Class none (test-only).
  2. Premise measured. The cases were born near 5 s. On CI they ran 4.57/4.65 s on their first commit ee9fccd9f and failed at 5174/5211/5426 ms. A phase profile shows no polling wait: each waitFor resolves on its first poll. fix(psa): a task moved out of Completed gives up its 100 % (#2768) #2771 is cleared: before and after timings match within noise. The 19 slowdown is about +15–20 % for the file (objectstack#38303, comment 7250586766).
  3. Gate check-runs on 04ae01b0. 19 of 19 succeed, read by L1. Shard 2 shows 29/29 psa tests, with trip cases at 4731/4538 ms.
  4. Accepted deviations.
    • The fifth case (Draft-on-locked, CI 3.2–4.4 s) shares the budget. The body discloses it.
    • L1 graded the shared "good" project idea as not a better fix: it saves about 25 % and couples the cases.
    • Nits, left as they are: a "1.8–2.0 s" vs 1.71–2.04 s wording slip at :638, and the pre-existing equal waitFor timeout at :703.
  5. Out of scope. None. Skills-docs: not owed.
  6. Landing. Reviewer class: the seat marks it ready, turns on auto-merge, and the merge queue squashes it. Fixes #2849. PRs feat(record-pages): quotes and contracts open on the default record page; the two empty shells go (#2740) #2847 and feat(revenue): a quote discounted above 30% goes to a sales manager for approval (#2751) #2848 then merge main to clear their shard-2 red.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 29, 2026 04:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit f3d4f1f Nov 29, 2026
20 checks passed
sunhaolin pushed a commit that referenced this pull request Nov 29, 2026
Brings in the shard-2 timeout fix from #2854.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcV3h25dAMNWki8e1ns
sunhaolin pushed a commit that referenced this pull request Nov 29, 2026
Brings in the shard-2 timeout fix from #2854.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017xRBcV3h25dAMNWki8e1ns
huangyiirene pushed a commit that referenced this pull request Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline

Projects

None yet

2 participants