The best way to control Claude Code, Codex and more from any computer or phone
Use Effect.sleep in orchestration integration tests
- replace custom Promise-based sleep helpers with `Effect.sleep` - remove now-unused integration sleep error class and harness error mapping
Julius Marminge committed
Feb 26, 2026 at 17:49 UTC
5aa517863a810010984f9c25a8acfd63f6322e65
2 files changed
+2
-17
apps/server/integration/OrchestrationEngineHarness.integration.ts
+1
-5
@@ -170,11 +170,7 @@ export interface OrchestrationIntegrationHarness {
170
}
171
172
export const makeOrchestrationIntegrationHarness = Effect.gen(function* () {
173
- const sleep = (ms: number) =>
174
- Effect.tryPromise({
175
- try: () => new Promise<void>((resolve) => setTimeout(resolve, ms)),
176
- catch: (cause) => new OrchestrationHarnessRuntimeError({ operation: "sleep", cause }),
177
- }).pipe(Effect.orDie);
173
+ const sleep = (ms: number) => Effect.sleep(ms);
174
const adapterHarness = yield* makeTestProviderAdapterHarness;
175
176
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "t3-orchestration-integration-"));
apps/server/integration/orchestrationEngine.integration.test.ts
+1
-12
@@ -45,13 +45,6 @@ function nowIso() {
45
return new Date().toISOString();
46
}
47
48
-class IntegrationSleepError extends Schema.TaggedErrorClass<IntegrationSleepError>()(
49
- "IntegrationSleepError",
50
- {
51
- cause: Schema.optional(Schema.Defect),
52
- },
53
-) {}
54
-
48
class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWaitTimeoutError>()(
49
"IntegrationWaitTimeoutError",
50
{
@@ -59,11 +52,7 @@ class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWai
52
},
53
) {}
54
62
-const sleep = (ms: number) =>
63
- Effect.tryPromise({
64
- try: () => new Promise<void>((resolve) => setTimeout(resolve, ms)),
65
- catch: (cause) => new IntegrationSleepError({ cause }),
66
- }).pipe(Effect.orDie);
55
+const sleep = (ms: number) => Effect.sleep(ms);
56
57
function waitForSync<A>(
58
read: () => A,