Skip to content

Share one TypeScript program in server-fn surface tests - #612

Merged
isuttell merged 2 commits into
mainfrom
cursor/spl-386-share-ts-program-a3b8
Sep 16, 2026
Merged

isuttell merged 2 commits into
mainfrom
cursor/spl-386-share-ts-program-a3b8

Conversation

@isuttell

@isuttell isuttell commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

server-fn-surface-test-helpers.test.ts rebuilt a control-panel TypeScript Program on every case. That sat near vitest's 5s default under runner contention and made hosted Verify flake on unrelated PRs.

This PR builds the program once in beforeAll and reuses it across cases. Assertions and helper behavior are unchanged. @splitch/stats is a different shape (one-off dynamic import), so it is not included.

Changes

  • Collect every probe fixture into one overlay map
  • Create a single sourceProgram in beforeAll
  • Reuse createServerFnSurfaceDiscovery for all cases

Risk: LOW

  • Areas touched: control-panel surface-discovery unit tests only
  • Security: none
  • Performance: removes repeated TypeScript program construction
  • Breaking: none

Test plan

Recorded on head f338e6a5 (Node v24.17.0, pnpm 11.8.0).

  • Shared-program file green under control-plane-api workers-pool contention, 3 times:
    cd apps/control-plane-api && pnpm exec vitest run --config vitest.config.workers.ts
    pnpm --filter @splitch/control-panel exec vitest run --config vitest.config.ts \
      src/lib/testing/server-fn-surface-test-helpers.test.ts
    Wall 2506ms / 1976ms / 2058ms; vitest 1.88s / 1.36s / 1.41s; 13/13 each (tests 1373ms / 923ms / 981ms)
  • Control-panel suite ×3 (parallel full-package verify of the file's workspace):
    pnpm --filter @splitch/control-panel test
    38.437s / 38.264s / 38.696s; 163 files / 1400 tests; surface file 989ms / 826ms / 1082ms
  • pnpm verify:ci --force green: 106/106, 8m25.935s (507048ms); surface file 5076ms under the full parallel graph (first case 503ms)
  • Hosted Verify green on f338e6a5 (run 35134277209)

Issue: SPL-386

Linear Issue: SPL-386

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

… tests

Build the control-panel TypeScript program once per file and reuse it
across cases so hosted Verify no longer times out under runner contention.

Issue: SPL-386

Co-authored-by: Isaac Suttell <isaac@zaks.io>
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include @coderabbitai review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 62aff32d-04c1-4792-b9f7-3720b4423d9e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@isuttell
isuttell marked this pull request as ready for review September 16, 2026 18:24
@isuttell
isuttell merged commit ce98570 into main Sep 16, 2026
4 checks passed
@isuttell
isuttell deleted the cursor/spl-386-share-ts-program-a3b8 branch September 16, 2026 18:46
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.

2 participants