MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / createEmulatorInstance

Function createEmulatorInstance

e2e/src/emulator-instance.ts:55–71  ·  view source on GitHub ↗
(service: string, label = "e2e")

Source from the content-addressed store, hash-verified

53// and retry with backoff. Nothing below this line retries anything the
54// scenario is actually asserting on.
55export const createEmulatorInstance = (service: string, label = "e2e"): Effect.Effect<string> =>
56 requestInstance(service, label).pipe(
57 Effect.timeoutOrElse({
58 duration: ATTEMPT_TIMEOUT,
59 orElse: () =>
60 Effect.fail(new EmulatorInstanceError(service, `no response in ${ATTEMPT_TIMEOUT}`)),
61 }),
62 Effect.retry(
63 Schedule.both(
64 Schedule.exponential("500 millis").pipe(Schedule.jittered),
65 Schedule.recurs(RETRIES),
66 ),
67 ),
68 // An emulator the suite cannot reach at all is a defect in the run, not a
69 // product failure the scenario should be asked to model.
70 Effect.orDie,
71 );

Calls 2

requestInstanceFunction · 0.85
retryMethod · 0.80

Tested by

no test coverage detected