| author | |
| committer | |
| log | 5aa517863a810010984f9c25a8acfd63f6322e65 |
| tree | eeee23ad28a51789d1478cb79237dc3f5535c6a5 |
| parent | 00cdf418996227f49ec2b45fde180a5230cb99e2 |
- replace custom Promise-based sleep helpers with `Effect.sleep`
- remove now-unused integration sleep error class and harness error mapping2 files changed, 2 insertions(+), 17 deletions(-)
apps/server/integration/OrchestrationEngineHarness.integration.ts+1-5| ... | @@ -170,11 +170,7 @@ export interface OrchestrationIntegrationHarness { | ... | @@ -170,11 +170,7 @@ export interface OrchestrationIntegrationHarness { |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | export const makeOrchestrationIntegrationHarness = Effect.gen(function* () { | 172 | export const makeOrchestrationIntegrationHarness = Effect.gen(function* () { |
| 173 | const sleep = (ms: number) => | 173 | const sleep = (ms: number) => Effect.sleep(ms); |
| 174 | Effect.tryPromise({ | ||
| 175 | try: () => new Promise<void>((resolve) => setTimeout(resolve, ms)), | ||
| 176 | catch: (cause) => new OrchestrationHarnessRuntimeError({ operation: "sleep", cause }), | ||
| 177 | }).pipe(Effect.orDie); | ||
| 178 | const adapterHarness = yield* makeTestProviderAdapterHarness; | 174 | const adapterHarness = yield* makeTestProviderAdapterHarness; |
| 179 | 175 | ||
| 180 | const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "t3-orchestration-integration-")); | 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,13 +45,6 @@ function nowIso() { |
| 45 | return new Date().toISOString(); | 45 | return new Date().toISOString(); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | class IntegrationSleepError extends Schema.TaggedErrorClass<IntegrationSleepError>()( | ||
| 49 | "IntegrationSleepError", | ||
| 50 | { | ||
| 51 | cause: Schema.optional(Schema.Defect), | ||
| 52 | }, | ||
| 53 | ) {} | ||
| 54 | |||
| 55 | class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWaitTimeoutError>()( | 48 | class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWaitTimeoutError>()( |
| 56 | "IntegrationWaitTimeoutError", | 49 | "IntegrationWaitTimeoutError", |
| 57 | { | 50 | { |
| ... | @@ -59,11 +52,7 @@ class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWai | ... | @@ -59,11 +52,7 @@ class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWai |
| 59 | }, | 52 | }, |
| 60 | ) {} | 53 | ) {} |
| 61 | 54 | ||
| 62 | const sleep = (ms: number) => | 55 | const sleep = (ms: number) => Effect.sleep(ms); |
| 63 | Effect.tryPromise({ | ||
| 64 | try: () => new Promise<void>((resolve) => setTimeout(resolve, ms)), | ||
| 65 | catch: (cause) => new IntegrationSleepError({ cause }), | ||
| 66 | }).pipe(Effect.orDie); | ||
| 67 | 56 | ||
| 68 | function waitForSync<A>( | 57 | function waitForSync<A>( |
| 69 | read: () => A, | 58 | read: () => A, |