| 1 | // Relative import (not `@/` alias) so this fixture runs as a bare bun/node |
| 2 | // child without a paths-aware loader. Excluded from the test project's |
| 3 | // typecheck (see tsconfig.test.json) because the relative path crosses |
| 4 | // composite-project boundaries. |
| 5 | import * as Effect from "effect/Effect"; |
| 6 | import { |
| 7 | installShutdownFeedback, |
| 8 | suppressInterruptMessages, |
| 9 | } from "../../../src/Cli/commands/errors.ts"; |
| 10 | |
| 11 | if (process.env.SHUTDOWN_FIXTURE_SUPPRESS === "1") { |
| 12 | Effect.runSync(suppressInterruptMessages); |
| 13 | } |
| 14 | Effect.runSync(installShutdownFeedback); |
| 15 | |
| 16 | // Simulates a teardown that takes this long after the first SIGINT. Without |
| 17 | // it the fixture never exits on its own (a hanging cleanup). |
| 18 | const exitAfter = Number.parseInt( |
| 19 | process.env.SHUTDOWN_FIXTURE_EXIT_AFTER_MS ?? "", |
| 20 | 10, |
| 21 | ); |
| 22 | if (Number.isFinite(exitAfter)) { |
| 23 | process.once("SIGINT", () => { |
| 24 | setTimeout(() => process.exit(0), exitAfter); |
| 25 | }); |
| 26 | } |
| 27 | |
| 28 | console.log("ready"); |
| 29 | setInterval(() => {}, 1000); |