@fourier-labs/harbour 0.1.28-rc.1 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -89,7 +89,6 @@ export async function runKitGate(root, options) {
|
|
|
89
89
|
const started = await ensureSession(root, runtime, bundle, output);
|
|
90
90
|
const port = await freePort();
|
|
91
91
|
const base = `http://127.0.0.1:${port}`;
|
|
92
|
-
const container = await runtime.startGate(bundle, port, base);
|
|
93
92
|
const deadline = Date.now() + (options.timeoutMs ?? 10 * 60_000);
|
|
94
93
|
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
95
94
|
const request = async (path, init) => { try {
|
|
@@ -99,7 +98,12 @@ export async function runKitGate(root, options) {
|
|
|
99
98
|
return undefined;
|
|
100
99
|
} };
|
|
101
100
|
const post = (path, body) => request(path, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) });
|
|
101
|
+
// Everything after the session is up runs under one `finally`: a gate
|
|
102
|
+
// container that fails to start is exactly the case that used to leave a
|
|
103
|
+
// session this run had started still running.
|
|
104
|
+
let container;
|
|
102
105
|
try {
|
|
106
|
+
container = await runtime.startGate(bundle, port, base);
|
|
103
107
|
let announced = false;
|
|
104
108
|
while (Date.now() < deadline) {
|
|
105
109
|
const done = await request("/_gate/report");
|
|
@@ -137,7 +141,8 @@ export async function runKitGate(root, options) {
|
|
|
137
141
|
throw new CliError("LOCAL_RUNTIME_FAILED", "The kit gate did not finish within its budget.");
|
|
138
142
|
}
|
|
139
143
|
finally {
|
|
140
|
-
|
|
144
|
+
if (container)
|
|
145
|
+
await runtime.stopGate(container);
|
|
141
146
|
if (started)
|
|
142
147
|
await runtime.down();
|
|
143
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.1.28
|
|
1
|
+
export const CLI_VERSION = "0.1.28";
|