@norskvideo/ctl-test-harness 0.1.27 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/smoke.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-test-harness",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
package/smoke.js CHANGED
@@ -187,6 +187,7 @@ export async function runProductSmoke(slug, spec, deps = defaultSmokeDeps) {
187
187
  };
188
188
  let daemon = null;
189
189
  let launched = false;
190
+ let registered = false;
190
191
  let handles = [];
191
192
  let journeyError;
192
193
  try {
@@ -226,6 +227,7 @@ export async function runProductSmoke(slug, spec, deps = defaultSmokeDeps) {
226
227
  if (added.name !== spec.product.name) {
227
228
  throw new Error(`product add registered '${added.name}', expected '${spec.product.name}'`);
228
229
  }
230
+ registered = true;
229
231
  // Template.
230
232
  let templateName;
231
233
  if ("name" in spec.template) {
@@ -327,6 +329,14 @@ export async function runProductSmoke(slug, spec, deps = defaultSmokeDeps) {
327
329
  }
328
330
  if (handles.length)
329
331
  await deps.stopSources(handles).catch(() => { });
332
+ // The control plane is a singleton that deliberately outlives its daemon, so
333
+ // stopping the daemon strands it holding 127.0.0.1:14321 and every later job
334
+ // on that runner fails to bind. Ask the daemon to remove it while there is
335
+ // still a daemon to ask. Best-effort: a teardown that throws here would mask
336
+ // the journey's own error, and a SIGKILLed job never reaches this line at all
337
+ // -- the workflow's reap covers that half.
338
+ if (registered)
339
+ await cli(["product", "remove", spec.product.name]).catch(() => { });
330
340
  // cleanupDaemon ends with rmSync(storeDir); Docker's root-owned bind-mount
331
341
  // targets make that EACCES on a non-root runner. Expected: the root nuke
332
342
  // below is what removes them. Only a store that survives the nuke fails.