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
This commit is contained in:
1 parent
74dbb98a40
commit
79affb0e06
2 files changed
+2
-17
No files matched your search
@@ -170,11 +170,7 @@ export interface OrchestrationIntegrationHarness {
|
||||
}
|
||||
|
||||
export const makeOrchestrationIntegrationHarness = Effect.gen(function* () {
|
||||
const sleep = (ms: number) =>
|
||||
Effect.tryPromise({
|
||||
try: () => new Promise<void>((resolve) => setTimeout(resolve, ms)),
|
||||
catch: (cause) => new OrchestrationHarnessRuntimeError({ operation: "sleep", cause }),
|
||||
}).pipe(Effect.orDie);
|
||||
const sleep = (ms: number) => Effect.sleep(ms);
|
||||
const adapterHarness = yield* makeTestProviderAdapterHarness;
|
||||
|
||||
const rootDir = fs.mkdtempSync(path.join(os.tmpdir(), "t3-orchestration-integration-"));
|
||||
|
||||
@@ -45,13 +45,6 @@ function nowIso() {
|
||||
return new Date().toISOString();
|
||||
}
|
||||
|
||||
class IntegrationSleepError extends Schema.TaggedErrorClass<IntegrationSleepError>()(
|
||||
"IntegrationSleepError",
|
||||
{
|
||||
cause: Schema.optional(Schema.Defect),
|
||||
},
|
||||
) {}
|
||||
|
||||
class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWaitTimeoutError>()(
|
||||
"IntegrationWaitTimeoutError",
|
||||
{
|
||||
@@ -59,11 +52,7 @@ class IntegrationWaitTimeoutError extends Schema.TaggedErrorClass<IntegrationWai
|
||||
},
|
||||
) {}
|
||||
|
||||
const sleep = (ms: number) =>
|
||||
Effect.tryPromise({
|
||||
try: () => new Promise<void>((resolve) => setTimeout(resolve, ms)),
|
||||
catch: (cause) => new IntegrationSleepError({ cause }),
|
||||
}).pipe(Effect.orDie);
|
||||
const sleep = (ms: number) => Effect.sleep(ms);
|
||||
|
||||
function waitForSync<A>(
|
||||
read: () => A,
|
||||
|
||||
Reference in new issue
Block a user