Skip to content

The Drift Log · Certifying that code does something

Isolating Harness Timeouts from Logic Bugs

19 November 2026 · 4 min read · 931 words · established

A crystal artifact under orange probe beams inside a test rig

When a test runner aborts on wall-clock time, conflating harness limits with assertion failures corrupts verification metrics. Here is how to isolate the two.

A CI runner terminates a test process after ten minutes without a trace. The build turns red, the pipeline retries, and the next run passes in forty seconds.

The immediate reaction is to label the component flaky. The second reaction is to bump the timeout from ten minutes to fifteen. Neither reaction answers the underlying question: did the component enter an infinite loop, or did the test harness feed the component an input size it was never specified to handle?

When a test suite fails via a wall-clock abort, treating the failure as an assertion failure corrupts your test metrics. A failed assertion means the code violated an invariant. A test harness timeout means the harness ran out of patience before it could observe an exit state. Conflating the two conceals whether your issue is a logic bug or an unconstrained verification contract.

When the Generator Outruns the Contract

Property-based testing and fuzzing harnesses generate pseudo-random inputs to find edge cases. Without strict input bounds, a generator will eventually produce inputs that are syntactically valid according to the type system but outside the operational envelope of the function under test.

Consider a simple Markdown table parser:

export function parseTable(raw: string): TableAst {
  if (raw.length > 65_536) {
    throw new InputTooLargeError();
  }
  return parseNestedTokens(raw);
}

If the harness generates a deeply nested, 64-kilobyte payload of unclosed brackets, a backtracking parser might execute for four hours before completing.

If the harness enforces a 500-millisecond timeout per iteration and aborts, the runner reports a failure. But the component did not crash, throw an unhandled exception, or return incorrect data. It simply executed an algorithm with polynomial time complexity on adversarial data within its accepted size limit.

To isolate this, you must separate your input contract validation from your algorithmic assertions. If the operational contract states the function only handles nesting up to twenty levels, that invariant must be enforced in the harness generator or asserted as a precondition in the component. When the harness generates inputs beyond what the contract promises to resolve within a given time budget, the harness itself is out of specification.

The Cost of the Binary Red/Green Trap

Most CI systems recognise only two states: zero exit code (green) or non-zero exit code (red). This binary model forces developers to turn test harness timeouts into test failures.

When a timeout is treated as a component failure:

  1. Developers write defensive timeouts into business logic. Code gets littered with cancellation tokens and artificial time-slicing that belongs in the orchestration layer, not in pure domain logic.
  2. Generators get crippled. To prevent timeouts, developers reduce the search space of property generators, missing boundary conditions that would execute quickly but reveal real state corruption.
  3. True logic hangs are ignored. An actual deadlock (for example, two workers waiting on reciprocal mutex acquisitions) gets dismissed as "just another runner timeout" and rerun until it passes by coincidence of thread scheduling.

Rigorous code verification requires distinguishing between an invalid state transition and an incomplete evaluation. As we discuss in our guide to certifying software invariants across the verification ladder, if a test execution cannot verify the contract within its bounded constraints, it has not proven the artifact broken. It has failed to evaluate it.

The Inconclusive Verdict

The correct response to an unconstrained harness timeout is an inconclusive verdict.

An inconclusive verdict states that the execution environment was unable to drive the component to a terminal state within the allotted bounds. It isolates the failure to the harness layer.

To implement this distinction, a verification runner requires two mechanisms:

  • Heartbeat and progress monitoring: The harness must distinguish between total CPU starvation / deadlock (zero progress) and active computation that exceeds the budget.
  • Precondition telemetry: When a test exceeds its execution threshold, the harness must log the exact generated input and call stack at termination.

If the call stack shows an active loop processing valid input, the harness bounds are wrong: either the input contract validation needs explicit constraints, or the operational performance budget must be revised. If the call stack shows an unyielding wait on an empty queue or a cycle in a state machine, you have isolated a genuine logic bug.

How SHPBL Handles Execution Bounds

At SHPBL, our certification harness executes harvested and engineered components against rigorous verification matrices. We do not flatten run results into a simplistic pass/fail binary.

Our harness records four explicit verdicts: CERTIFIED, PROVISIONAL (reproducible, but correctness invariants are not yet fully asserted), INCONCLUSIVE (the harness could not exercise the input contract due to execution or environment limits), and FAILED.

When an artifact run hits an execution boundary without violating an invariant or crashing, our harness returns INCONCLUSIVE. This treats harness constraints as harness limits, keeping logic failures distinct from unconstrained inputs.

Instrumenting the Separation

On Monday, look at the last three flaky timeouts in your test suite:

  1. Capture the seed and payload. Ensure that every harness timeout dumps the exact input vector that triggered the run. If you cannot reproduce the exact input instantly, your harness is hiding state.
  2. Inspect the thread state. If the abort happens while the process is at 100% CPU on valid input, do not bump the global CI timeout. Add explicit bounds to your harness generator or add an explicit input limit to the component contract.
  3. Separate deadlocks from compute time. Set a strict, short watchdog for zero-progress states (such as deadlocks) and a separate, documented operational budget for heavy computation.

Stop treating a slow runner as a broken component. Name the inconclusive state explicitly, fix the harness bounds, and let your test failures represent real defects in logic.

This post supports the longer argument in Certifying Software Invariants Across the Verification Ladder.

Keep reading

Next in the log

The Strategic Master Library · written and reviewed under the house's own epistemic rules: nothing claimed that we cannot show.