feat: provide deterministic test runtime controls - #1730
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
Changes결정적 테스트 런타임
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant TestKernel
participant TestRuntime
participant TestClock
participant RateLimitStore
participant TaskRunner
participant Diagnostics
TestKernel->>TestRuntime: 런타임 옵션 생성
TestRuntime->>TestClock: 가상 시계 제공
TestKernel->>RateLimitStore: clock, random, scheduler 주입
TestKernel->>TaskRunner: now, schedule 주입
RateLimitStore->>TestClock: 현재 시각 조회 및 작업 예약
TaskRunner->>TestClock: 타임아웃 작업 예약
TestKernel->>Diagnostics: 누수와 replay 정보 보고
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Benchmark Results✅ All benchmarks passed
Updated: 2026-08-05T05:31:00.629Z · Commit: 497eb55 |
|
This PR does not modify |
9442ad4 to
a8bb660
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/testing/src/libs/TestKernel.ts (1)
485-492: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
trackInFlight에서 거부 사유를 완전히 버린다.
operation.then(onFulfilled, onRejected)의 두 콜백 모두this.inFlight.delete(operation)만 수행한다. 추적된 프라미스가 거부(reject)되어도 그 원인은 어디에도 기록되지 않는다.
waitUntil처럼 호출자가 반환된 프라미스를 기다리지 않는 경로에서는, 백그라운드 작업이 실패해도 정상 완료된 것과 구분할 수 없다. 이 파일이 목표로 하는 구조화된 누수 진단(structured leak diagnostics)의 취지와 어긋난다.거부된 원인을 별도 버퍼에 남기고
expectClean/disposeOnce의 진단 정보에 포함하라.🛠️ 실패 원인을 보존하는 수정 제안
- private readonly inFlight = new Map<Promise<unknown>, TestKernelTrackedWork>(); + private readonly inFlight = new Map<Promise<unknown>, TestKernelTrackedWork>(); + private readonly trackedFailures: Array<{ error: Error; work: TestKernelTrackedWork }> = [];private trackInFlight<T>(operation: Promise<T>, work: TestKernelTrackedWork): Promise<T> { this.inFlight.set(operation, work); void operation.then( () => this.inFlight.delete(operation), - () => this.inFlight.delete(operation), + (error: unknown) => { + this.inFlight.delete(operation); + this.trackedFailures.push({ error: toError(error), work }); + }, ); return operation; }As per coding guidelines, "request lifecycle, trace, retry, event, Problem, DI scope, telemetry init/flush 경계에는 원인 추적 가능한 evidence를 남기며, 관측 실패를 비즈니스 성공처럼 보이게 하지 않는다."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/testing/src/libs/TestKernel.ts` around lines 485 - 492, Update trackInFlight to preserve each rejected operation’s reason in a dedicated diagnostic buffer instead of discarding it after removing the operation from inFlight. Include the buffered rejection evidence in the diagnostics produced by expectClean and disposeOnce, while keeping successful operations’ existing cleanup behavior unchanged.Source: Coding guidelines
packages/testing/src/tests/TestKernel.spec.ts (1)
617-629: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
rejects.toBeInstanceOf(TestKernelDisposalProblem)를rejects.toThrow(TestKernelDisposalProblem)로 바꾸라. Vitest 가이드라인에서 비동기 오류는rejects.toThrow로 검증하고, 생성자 인자를 쓴toThrow는 동일한instanceof테스트를 수행한다.
packages/testing/src/tests/TestKernel.spec.ts#L629:rejects.toBeInstanceOf(TestKernelDisposalProblem)을rejects.toThrow(TestKernelDisposalProblem)로 변경하라.packages/testing/src/tests/TestKernel.spec.ts#L814:rejects.toBeInstanceOf(TestKernelDisposalProblem)을rejects.toThrow(TestKernelDisposalProblem)로 변경하라.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/testing/src/tests/TestKernel.spec.ts` around lines 617 - 629, Update both TestKernel.spec.ts sites at lines 617-629 and 789-815: replace the asynchronous disposal assertions using rejects.toBeInstanceOf(TestKernelDisposalProblem) with rejects.toThrow(TestKernelDisposalProblem), preserving the existing TestKernelDisposalProblem constructor assertion.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/ratelimit-core/src/libs/InMemoryRateLimitStore.ts`:
- Around line 13-16: Extend InMemoryRateLimitStoreOptions with a cancellable
scheduler contract that supports scheduling prune callbacks, and update all
three store implementations to use it instead of global setInterval. Ensure the
scheduler integrates with virtual time so advancing time runs pending prune
work, and make each store’s close() cancel its scheduled prune operation.
In `@packages/tasks-core/src/index.ts`:
- Line 29: Separate the combined export in packages/tasks-core/src/index.ts:
keep TaskRunner in the value export group, and add TaskRunnerRuntime as a
standalone type export in the file’s final type-export group, following the
barrel export ordering guidelines.
In `@packages/tasks-core/src/tests/TaskRunner.spec.ts`:
- Around line 671-684: Update the schedule mock in the controlled timed-task
test to capture the provided delayMs and assert it equals 100 before triggering
the callback. Change the result assertion from
rejects.toBeInstanceOf(TaskExecutionTimeoutProblem) to
rejects.toThrow(TaskExecutionTimeoutProblem), preserving the existing timeout
execution flow.
In `@packages/testing/src/libs/TestRuntime.ts`:
- Around line 190-200: Update TestNetwork.fetch to be async so denied requests
return a rejected Promise rather than throwing synchronously, and ensure
malformed URLs are converted to TestKernelOutboundCallProblem instead of leaking
a native TypeError. Update the affected TestRuntime tests to await fetch and use
rejects.toThrow assertions.
---
Outside diff comments:
In `@packages/testing/src/libs/TestKernel.ts`:
- Around line 485-492: Update trackInFlight to preserve each rejected
operation’s reason in a dedicated diagnostic buffer instead of discarding it
after removing the operation from inFlight. Include the buffered rejection
evidence in the diagnostics produced by expectClean and disposeOnce, while
keeping successful operations’ existing cleanup behavior unchanged.
In `@packages/testing/src/tests/TestKernel.spec.ts`:
- Around line 617-629: Update both TestKernel.spec.ts sites at lines 617-629 and
789-815: replace the asynchronous disposal assertions using
rejects.toBeInstanceOf(TestKernelDisposalProblem) with
rejects.toThrow(TestKernelDisposalProblem), preserving the existing
TestKernelDisposalProblem constructor assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5a7c8525-e17e-42e6-908d-91b7fae46217
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (17)
.changeset/deterministic-test-runtime-controls.mddocs/problem-code-registry.jsonpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/ratelimit-core/src/libs/InMemoryRateLimitStore.tspackages/ratelimit-core/src/libs/RateLimitStore.tspackages/tasks-core/src/index.tspackages/tasks-core/src/libs/TaskRunner.tspackages/tasks-core/src/tests/TaskRunner.spec.tspackages/testing/README.mdpackages/testing/package.jsonpackages/testing/src/index.tspackages/testing/src/libs/TestKernel.tspackages/testing/src/libs/TestRuntime.tspackages/testing/src/tests/TestKernel.spec.tspackages/testing/src/tests/TestRuntime.spec.tspackages/testing/tsconfig.jsonpublic-api-surface.snapshot.json
07e45bc to
2137d46
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/ratelimit-core/src/libs/InMemoryRateLimitStore.ts`:
- Around line 20-22: Change RateLimitPruneScheduler from a type alias to an
interface while preserving its existing schedule method signature and behavior.
In `@packages/testing/src/libs/TestRuntime.ts`:
- Around line 83-87: Update the scheduling state used by pendingWork and
nextScheduled so each queued item retains its numeric scheduledSequence
separately from its string id. When dueAtMs values are equal, sort by that
numeric sequence instead of id.localeCompare, preserving insertion order for IDs
such as scheduled-10 and scheduled-2 while leaving due-time ordering unchanged.
- Around line 116-133: Update TestRuntime.drain and its drainUntil flow to
prevent non-terminating execution when callbacks such as InMemoryRateLimitStore
cleanup reschedule work at the same dueAtMs. Add a bounded iteration safeguard
that throws an identifiable Problem after exceeding the limit, or enforce the
documented contract that callbacks may not reschedule during draining; preserve
normal draining behavior for finite schedules.
In `@packages/testing/src/tests/TestRuntime.spec.ts`:
- Around line 51-70: The test only covers string-seed initialization and not
reuse of an existing TestIdSource. Extend the test around TestRuntime
construction to pass a previously advanced TestIdSource instance via ids, then
verify the runtime continues that source’s existing sequence rather than
resetting it; preserve the existing environment, replay, and deterministic-value
assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e599791d-3a66-4abe-8496-600e25f18f46
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
.changeset/deterministic-test-runtime-controls.mddocs/problem-code-registry.jsonpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/ratelimit-core/src/index.tspackages/ratelimit-core/src/libs/InMemoryRateLimitStore.tspackages/ratelimit-core/src/libs/RateLimitStore.tspackages/tasks-core/src/index.tspackages/tasks-core/src/libs/TaskRunner.tspackages/tasks-core/src/tests/TaskRunner.spec.tspackages/testing/README.mdpackages/testing/package.jsonpackages/testing/src/index.tspackages/testing/src/libs/TestKernel.tspackages/testing/src/libs/TestRuntime.tspackages/testing/src/tests/TestKernel.spec.tspackages/testing/src/tests/TestRuntime.spec.tspackages/testing/tsconfig.jsonpublic-api-surface.snapshot.json
c252343 to
318c779
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/tasks-core/src/libs/TaskRunner.ts`:
- Around line 17-20: TaskRunnerRuntime의 선언을 type alias에서 interface로 변경하여 호출자가
구현하는 런타임 주입 계약으로 표현하십시오. now와 schedule 속성의 readonly 및 선택적 특성과 각 함수 시그니처는 그대로
유지하십시오.
In `@packages/tasks-core/src/tests/TaskRunner.spec.ts`:
- Line 645: Update the Component decorator on the test handler in
TaskRunner.spec.ts to explicitly set its registration scope to singleton,
preserving the handler’s existing behavior and avoiding reliance on the default
scope.
In `@packages/testing/package.json`:
- Line 63: packages/testing의 `@croco/retry-core` 의존성을 dependencies에서
devDependencies로 이동하십시오. packages/testing/src의 컴파일 및 타입 검사에 필요한 사용은 유지하되, 외부 런타임
의존성으로 설치되지 않도록 package.json의 의존성 구성을 수정하십시오.
In `@packages/testing/src/libs/TestKernel.ts`:
- Around line 516-527: Update createTestKernel’s runtimeOptions construction so
an existing options.ids TestIdSource is duplicated through its state-preserving
fork() rather than recreated from seed. Add fork() implementations to
TestIdSource and TestRandomSource that preserve sequence progress and internal
random state, then use the forked source when creating the kernel.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3a489cf3-1b35-4d46-a8b8-47889e10ad4e
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
.changeset/deterministic-test-runtime-controls.mddocs/problem-code-registry.jsonpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/ratelimit-core/src/index.tspackages/ratelimit-core/src/libs/InMemoryRateLimitStore.tspackages/ratelimit-core/src/libs/RateLimitStore.tspackages/tasks-core/src/index.tspackages/tasks-core/src/libs/TaskRunner.tspackages/tasks-core/src/tests/TaskRunner.spec.tspackages/testing/README.mdpackages/testing/package.jsonpackages/testing/src/index.tspackages/testing/src/libs/TestKernel.tspackages/testing/src/libs/TestRuntime.tspackages/testing/src/tests/TestKernel.spec.tspackages/testing/src/tests/TestRuntime.spec.tspackages/testing/tsconfig.jsonpublic-api-surface.snapshot.json
1036e87 to
0fc2d6b
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/tasks-core/src/libs/TaskRunner.ts (1)
177-180: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value
TaskRunner에runtime.now를 주입해 timeout 시계를 통일해도 됩니다.
executionManager.start()는Date.now()로startedAt을 기록하고,new TaskRunner()기본 구성은runtime.now가 없을 때Date.now()만 사용합니다. DI로 주입되는runtime.now가 있다면ExecutionManager의 시작 시각도 같은 시계로 기록하거나,TaskRunnerRuntime의 가상 시계도 실제 시각과 동기화되도록 설정해야 합니다.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/tasks-core/src/libs/TaskRunner.ts` around lines 177 - 180, Unify timeout timing between TaskRunner and ExecutionManager by using the injected TaskRunnerRuntime.now when recording startedAt in ExecutionManager.start(). Preserve Date.now() only as the fallback when no runtime clock is provided, so TaskRunner’s deadline calculation uses the same clock source as execution startup.
♻️ Duplicate comments (1)
packages/testing/src/libs/TestRuntime.ts (1)
138-155: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
drain()의 전체 실행에 callback 상한을 적용하십시오.
callbackCount는drainUntil()을 호출할 때마다 0으로 초기화됩니다. 양수 지연으로 자신을 다시 예약하는 callback은 외부while반복마다 한 번 실행됩니다. 따라서MAX_DRAIN_CALLBACKS에 도달하지 않으며drain()은 종료되지 않습니다.하나의 callback 예산을
drain()의 모든drainUntil()호출에서 공유하십시오. 양수 지연의 반복 작업을 사용하는 회귀 테스트도 추가하십시오.🐛 수정 예시
async drain(): Promise<void> { + const budget = { callbackCount: 0 }; while (this.scheduled.size > 0) { const next = this.nextScheduled(); if (!next) return; - await this.drainUntil(next.dueAtMs); + await this.drainUntil(next.dueAtMs, budget); } } - private async drainUntil(targetTime: number): Promise<void> { - let callbackCount = 0; + private async drainUntil( + targetTime: number, + budget = { callbackCount: 0 }, + ): Promise<void> { while (true) { const next = this.nextScheduled(); if (!next || next.dueAtMs > targetTime) return; - callbackCount += 1; - if (callbackCount > MAX_DRAIN_CALLBACKS) { + budget.callbackCount += 1; + if (budget.callbackCount > MAX_DRAIN_CALLBACKS) { throw new TestRuntimeDrainProblem(MAX_DRAIN_CALLBACKS); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/testing/src/libs/TestRuntime.ts` around lines 138 - 155, Update drain() and drainUntil() in TestRuntime so a single callback count is shared across the entire drain operation instead of resetting on each drainUntil() call. Enforce MAX_DRAIN_CALLBACKS for callbacks that reschedule themselves with positive delays, and add a regression test covering this repeating-work case.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/ratelimit-core/src/libs/InMemoryRateLimitStore.ts`:
- Around line 51-60: Validate pruneIntervalMs before selecting or invoking the
default scheduler in the rate-limit store setup around scheduleNext. When using
the native/default scheduler, require a finite delay within the scheduler’s
supported setTimeout range and reject invalid values, including NaN, positive
infinity, and oversized intervals, with a stable configuration Problem; preserve
the existing disabled behavior for non-positive intervals.
In `@packages/testing/src/index.ts`:
- Around line 97-102: Move the newly added type exports, including
TestKernelLeak, TestKernelTrackedWork, and TestKernelRuntime-related types, out
of their current category blocks into a final export type section at the end of
the index module. Keep all value exports in their existing category groups and
preserve each type export without changing its name or source.
In `@packages/testing/src/libs/TestRuntime.ts`:
- Line 118: Validate the parsed delay, computed dueAtMs, and replay targetTime
in TestRuntime so each remains a safe integer within the valid Date range before
storing or converting it. Reject invalid values by throwing
TestRuntimeConfigurationProblem, covering both pendingWork scheduling and replay
paths, while preserving valid timing behavior.
In `@packages/testing/src/tests/TestKernel.spec.ts`:
- Around line 13-19: Separate the TestKernel type import from the value imports
by keeping the existing ../index value import unchanged and adding a distinct
import type declaration for TestKernel from the same module.
- Line 716: Remove the non-null assertion from bootstrapReplay in
TestKernel.spec.ts and declare it as allowing undefined. After bootstrap, assert
that kernel.replay and bootstrapReplay are defined immediately before their
respective expectations, preserving the existing replay validation flow.
---
Outside diff comments:
In `@packages/tasks-core/src/libs/TaskRunner.ts`:
- Around line 177-180: Unify timeout timing between TaskRunner and
ExecutionManager by using the injected TaskRunnerRuntime.now when recording
startedAt in ExecutionManager.start(). Preserve Date.now() only as the fallback
when no runtime clock is provided, so TaskRunner’s deadline calculation uses the
same clock source as execution startup.
---
Duplicate comments:
In `@packages/testing/src/libs/TestRuntime.ts`:
- Around line 138-155: Update drain() and drainUntil() in TestRuntime so a
single callback count is shared across the entire drain operation instead of
resetting on each drainUntil() call. Enforce MAX_DRAIN_CALLBACKS for callbacks
that reschedule themselves with positive delays, and add a regression test
covering this repeating-work case.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: aaf13885-2578-4d9e-a84a-42881b290499
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (18)
.changeset/deterministic-test-runtime-controls.mddocs/problem-code-registry.jsonpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/ratelimit-core/src/index.tspackages/ratelimit-core/src/libs/InMemoryRateLimitStore.tspackages/ratelimit-core/src/libs/RateLimitStore.tspackages/tasks-core/src/index.tspackages/tasks-core/src/libs/TaskRunner.tspackages/tasks-core/src/tests/TaskRunner.spec.tspackages/testing/README.mdpackages/testing/package.jsonpackages/testing/src/index.tspackages/testing/src/libs/TestKernel.tspackages/testing/src/libs/TestRuntime.tspackages/testing/src/tests/TestKernel.spec.tspackages/testing/src/tests/TestRuntime.spec.tspackages/testing/tsconfig.jsonpublic-api-surface.snapshot.json
4d3d57d to
4edd6b7
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/ratelimit-core/src/tests/InMemoryRateLimitStore.spec.ts`:
- Around line 28-35: Update the test file’s beforeEach setup to reset the DI
Container as its first step, then initialize the store instance. Follow the
existing Vitest setup pattern so each test, including the InMemoryRateLimitStore
constructor validation cases, starts with isolated container state.
In `@packages/tasks-core/src/index.ts`:
- Line 42: Reorganize the exports in the package index so all type-only exports
appear in the final group. Move the RegisteredTask type export from its current
position before value exports and combine it with TaskRunnerRuntime, while
preserving the existing value-export grouping.
In `@packages/testing/src/libs/TestKernel.ts`:
- Around line 536-547: Update the fidelityContext construction in the TestKernel
bootstrap flow so replay is exposed through a dynamic getter backed by the
current controls.replay value, rather than capturing controls.replay at
initialization. Preserve the TestRuntime.replay contract so reads after
clock.advanceBy() return the updated virtualTime, and add a test covering this
post-advance replay value.
In `@packages/testing/src/tests/TestRuntime.spec.ts`:
- Around line 1-13: TestRuntime 테스트에 각 테스트 전 DI 컨테이너를 초기화하는 beforeEach 훅을
추가하십시오. Vitest의 beforeEach를 import하고 resetCrocoTestingContext를 ../index에서 가져와,
rate-limit 및 retry 전역 등록 상태가 테스트마다 격리되도록 TestRuntime describe 블록에서 호출하십시오.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6022e06f-133a-4182-8ec6-20bc1bdda82b
⛔ Files ignored due to path filters (2)
packages/problems-core/src/generated/problem-code-registry.tsis excluded by!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (20)
.changeset/deterministic-test-runtime-controls.mddocs/problem-code-registry.jsonpackages/docs/src/content/docs/en/reference/problem-recovery-cookbook.mdpackages/ratelimit-core/src/index.tspackages/ratelimit-core/src/libs/InMemoryRateLimitStore.tspackages/ratelimit-core/src/libs/RateLimitStore.tspackages/ratelimit-core/src/libs/problems/RateLimitConfigProblems.tspackages/ratelimit-core/src/tests/InMemoryRateLimitStore.spec.tspackages/tasks-core/src/index.tspackages/tasks-core/src/libs/TaskRunner.tspackages/tasks-core/src/tests/TaskRunner.spec.tspackages/testing/README.mdpackages/testing/package.jsonpackages/testing/src/index.tspackages/testing/src/libs/TestKernel.tspackages/testing/src/libs/TestRuntime.tspackages/testing/src/tests/TestKernel.spec.tspackages/testing/src/tests/TestRuntime.spec.tspackages/testing/tsconfig.jsonpublic-api-surface.snapshot.json
c4e11f1 to
16970b2
Compare
16970b2 to
97ee02c
Compare
Summary
Provide TestKernel-owned virtual time, seeded IDs/randomness, scoped environment snapshots, explicit provider egress denial, replay metadata, and structured leak diagnostics.
Retry backoff, task timeout, and in-memory rate-limit seams now accept those controls without patching global runtime state.
Fixes #1483
Verification
@croco/testing— 125 tests, typecheck, lint, and formatting@croco/tasks-core— 69 tests and typecheck@croco/ratelimit-core— 88 tests and typecheckSummary by CodeRabbit
새로운 기능
문서