chenglou/pretext · error · Error

Missing keep-all result for ${testCase.label}

Error message

Missing keep-all result for ${testCase.label}

What it means

After a successful (status='ready') batch report, runBrowser() iterates KEEP_ALL_ORACLE_CASES and looks up each case's label in the results map. If a defined case has no corresponding entry in the batch results, this throws. It means the batch round-tripped fine but is incomplete relative to the oracle case set.

Source

Thrown at scripts/keep-all-check.ts:160

      const batchReport = await loadPostedReport(
        session,
        url,
        () => reportServer.waitForReport(null),
        requestId,
        reportBrowser,
        timeoutMs,
      )
      if (batchReport.status === 'error') {
        throw new Error(batchReport.message ?? 'keep-all batch failed')
      }

      const batchResults = batchReport.results ?? []
      const reportsByLabel = new Map(batchResults.map(result => [result.label, result.report]))
      for (const testCase of KEEP_ALL_ORACLE_CASES) {
        if (!caseRunsInBrowser(testCase, browser)) continue
        const report = reportsByLabel.get(testCase.label)
        if (report === undefined) {
          throw new Error(`Missing keep-all result for ${testCase.label}`)
        }
        printCaseResult(browser, testCase, report)
        if (!reportIsExact(report)) ok = false
      }
    } finally {
      reportServer.close()
    }
  } finally {
    session?.close()
    serverProcess?.kill()
    lock.release()
  }

  return ok
}

const port = await getAvailablePort(requestedPort === 0 ? null : requestedPort)
let overallOk = true

View on GitHub (pinned to ac49b09b7d)

Solutions

  1. Open src/test-data.ts KEEP_ALL_ORACLE_CASES and the probe batch page, and confirm every label defined in the former is produced by the latter.
  2. Inspect the browser console / page logs for a per-case exception that swallowed a result.
  3. If the missing case is genuinely not applicable to the current probe, gate it via its `browsers` field or remove it from KEEP_ALL_ORACLE_CASES.
Defensive patterns

Strategy: validation

Validate before calling

// After receiving the batch report, assert coverage before iterating
const produced = new Set((batchReport.results ?? []).map(r => r.label))
const missing = KEEP_ALL_ORACLE_CASES.filter(c => caseRunsInBrowser(c, browser) && !produced.has(c.label))
if (missing.length) {
  console.error(`Probe omitted labels: ${missing.map(c => c.label).join(', ')}`)
  process.exit(1)
}

Prevention

When it happens

Trigger: The probe page ran and posted a 'ready' report, but omitted a result for one of the KEEP_ALL_ORACLE_CASES labels — e.g. a case was added to src/test-data.ts but the probe page's batch handler was not updated to emit it, or a case threw silently on the page and was skipped.

Common situations: Adding a new oracle case to test-data.ts without wiring it into the probe batch renderer; or a per-case exception in the page swallowed the result.

Related errors


AI-assisted analysis of chenglou/pretext@ac49b09b7d (2026-08-12). Data as JSON: /api/errors/7e31527808ddbe75. Report an issue: GitHub.