| 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 | 170 | } |
| 171 | 171 | |
| 172 | 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); | |
| 178 | 174 | const adapterHarness = yield* makeTestProviderAdapterHarness; |
| 179 | 175 | |
| 180 | 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 | 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 | 48 | class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWaitTimeoutError>()( |
| 56 | 49 | "IntegrationWaitTimeoutError", |
| 57 | 50 | { |
| ... | ... | @@ -59,11 +52,7 @@ class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWai |
| 59 | 52 | }, |
| 60 | 53 | ) {} |
| 61 | 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); | |
| 67 | 56 | |
| 68 | 57 | function waitForSync<A>( |
| 69 | 58 | read: () => A, |