Skip to content

test(app): eliminate real waits in durable learning tests - #1933

Merged
JAORMX merged 1 commit into
mainfrom
test/learning-virtual-time
Sep 25, 2026
Merged

JAORMX merged 1 commit into
mainfrom
test/learning-virtual-time

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Run two slow learning tests inside testing/synctest bubbles so the durable worker's discovery cadence and test polling advance in virtual time:

  • One isolated bubble per TestUsableAutoSkillsStockBuildPolicyMatrix subtest; T.Run stays outside the bubble.
  • One bubble around TestBuildSharesLearningAdmissionAcrossSharedAndSelectedProviderEngines.

Real Build, durable stores, temporary directories, provider scripts, every existing assertion, and deferred Built.Close() remain inside the bubbles. Production polling remains one second. No production changes, shortened timer constants, or new clock API.

Most of the diff is indentation; hiding whitespace shows the two imports and wrappers.

Measured benefit

Same selection, forced uncached with -count=1, measured through go test -json:

Test Before After
Stock skill policy matrix 9.44 s 0.29 s
Shared/selected-provider admission 3.02 s 0.02 s
Selected package run 12.48 s 0.334 s

These are selected-test measurements, not a claim about the entire suite's percentage improvement.

Verification

Passed on fa770757ae396d01929baaece57052f42f868f61:

  • task test GOPROXY=off
  • task lint (the first aggregate invocation timed out during engine lint after root lint passed; a larger-budget rerun completed all modules)
  • task test:race GOPROXY=off
  • Offline demo, including tool call, permission ask/approval, and successful result
  • git diff --check

Additional checks:

  • Both selected tests passed 20 repetitions under -race.
  • Mutation proof: disabling attempt-work processing made all nine learning-enabled matrix cases and the shared-provider test fail; the learning-off case still passed. The mutation was reverted before final verification.
  • Independent test review found no blockers or important findings.

Scope

Routine: test-only replacement of real waiting with standard-library virtual time. No public behavior, API, storage contract, assertion, or documentation changes.

Run the stock skill policy matrix and shared-provider learning admission test inside synctest bubbles, retaining real Build, durable storage, assertions, and cleanup.

Co-Authored-By: mecatl <[email protected]>
@JAORMX
JAORMX merged commit 32535bf into main Sep 25, 2026
36 checks passed
@JAORMX
JAORMX deleted the test/learning-virtual-time branch September 25, 2026 12:46
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 25, 2026
2 tasks
jbeda added a commit that referenced this pull request Sep 25, 2026
…mit-coauthor-guidance

* origin/main: (32 commits)
  docs: plan optional native Kubernetes execution provider (#1579)
  feat(mecatui): restore session status metrics (#1891)
  docs(plan): bound agent inventory viewport (#1946)
  docs: include user-docs in matlatl and use local documentation links (#1934)
  feat(mecatui): bound sessions inventory (#1944)
  feat(studio): show session delegation activity (#1907)
  docs(plan): define Studio session activity (#1885)
  Release TypeScript SDK v0.4.0 (#1940)
  Release v0.0.41 (#1941)
  docs(mecatui): plan bounded sessions inventory (#1906)
  feat(studio): add exact plan control and authorization review prerequisite (#1909)
  test(app): eliminate real ToolHive probe deadline wait (#1937)
  docs(plan): define Studio chat approvals and exact plan control (#1888)
  test(sdk): enforce SDK/TUI high-level parity (#1471) (#1917)
  docs(plan): propose SDK high-level parity coverage (#1471) (#1916)
  docs: improve gRPC schema table readability (#1842)
  test(app): eliminate real waits in durable learning tests (#1933)
  feat(studio): align chat transcript and composer (#1886)
  docs(plan): define Studio chat transcript and composer (#1880)
  feat: correlate provider requests with the root session (#1883)
  ...
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.

1 participant