Skip to content

x86 prod gate: the console-prompt count assertion aborts via set -e instead of failing through the verdict trap (PROMPT_BEFORE=0 under host contention) #884

Description

@ryanbreen

Summary

The x86 production-profile boot test script (docker/qemu/run-x86-prod-profile-boot-test.sh) has a bare test assertion that checks the console prompt count, which aborts via set -e instead of routing through the verdict trap. This is the #802 class of pre-empting exit that bypasses proper failure handling and reporting.

What the Assertion Checks

Lines ~1248-1249:

test "$PROMPT_BEFORE" -eq 1
test "$PROMPT_AFTER" -eq 2

These assertions validate the liveness signal: a steady-state prompt is printed once at start (PROMPT_BEFORE=1), and exactly one additional prompt is earned by the stimulus (PROMPT_AFTER=2). This proves the kernel is executing and responding to UART input.

Observed Failure

During PR #883 landing on beast (attempt 1): the script aborted with set -e at the PROMPT_BEFORE assertion when PROMPT_BEFORE=0 and PROMPT_AFTER=1, indicating the steady-state prompt was never printed (typical under host contention). The abort bypassed the verdict trap, leaving no proper error reporting, GATE_BOOT_FACTS record, or ended_by marker.

Why This Is #802 Class

PR #805 fixed a similar issue: AF_UNIX preflights in this same script were aborting via bare exit before the ERR trap was installed, pre-empting the verdict path. PR #818 widened that fix to six sibling gate scripts. The PROMPT assertions carry the same pre-empting shape — they run after the trap is armed but under set -e, so a failure kills the script without invoking report_gate_failure.

The Ask

  1. Route through the verdict trap: Convert the bare test assertions to a check-and-false idiom that routes failures through report_gate_failure, similar to PR gates: every gate script with a verdict trap fails through it - six sibling gates repaired, 66 pre-empting exits removed, the ratchet widened by shape (the #802 class) #818's pattern (e.g., use || groups and false).
  2. Record failure facts: Ensure the error captures PROMPT_BEFORE and PROMPT_AFTER values in the diagnosis output and/or a distinct FAIL text for this class of failure.
  3. Extend the ratchet: Update tests/teardown_structure.rs to include run-x86-prod-profile-boot-test.sh in the verdict-trap shape census (similar to the test at line ~6815 for other x86 gates), verifying that:
    • The script installs its ERR trap before any assertion that could fail
    • All failures route through the trap (no bare exits or set -e aborts pre-empting verdict)
    • A verdict is computed and explicitly tested

Related

#802 #805 #818 #826 #865 #871

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions