@sudobility/testomniac_runner 0.0.173 → 0.0.174

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/testomniac_runner",
3
- "version": "0.0.173",
3
+ "version": "0.0.174",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -112,7 +112,14 @@ export class RunnerManager {
112
112
  "runner not found for pending run"
113
113
  );
114
114
  try {
115
- await api.completeTestRun(pendingRun.id, { status: "failed" });
115
+ // Use /scan/end for closeout (not the legacy completeTestRun). The
116
+ // run was never claimed/started, so there is no bundle work to
117
+ // cancel — just mark the test run failed.
118
+ await api.scanEnd({
119
+ testRunId: pendingRun.id,
120
+ status: "failed",
121
+ runDetection: false,
122
+ });
116
123
  } catch (err) {
117
124
  logger.error(
118
125
  { err, runId: pendingRun.id },
@@ -226,8 +233,20 @@ export class RunnerManager {
226
233
  // clobber the server-side closeout. This stays purely as a backstop for
227
234
  // the rare case the inner service threw before owning closeout.
228
235
  try {
236
+ // Best-effort: resolve the bundle run so the backstop closeout can also
237
+ // cancel pending interaction runs and close surface/bundle runs — not
238
+ // just the test_run. Falls back to test-run-only closeout if the lookup
239
+ // fails (still better than leaving it open).
240
+ let bundleRunId: number | undefined;
241
+ try {
242
+ const testRun = await api.getTestRun(params.runId);
243
+ bundleRunId = testRun?.testSurfaceBundleRunId ?? undefined;
244
+ } catch {
245
+ // ignore — fall back to test-run-only closeout
246
+ }
229
247
  await api.scanEnd({
230
248
  testRunId: params.runId,
249
+ bundleRunId,
231
250
  status: "failed",
232
251
  runDetection: false,
233
252
  });