Skip to main content

Infinite test loops silently burning CI credits.

· One min read
Daniel Maß
Maintainer of Xcepto

Most developers run into this eventually.

A test blocks forever. Seconds turn into minutes. Eventually, GitHub kills the job after an hour. But the damage has already been done: CI costs have silently piled up.

Why timeout handling gets messy​

The obvious solution is adding timeouts. But implementing reliable timeout handling is harder than it sounds.

You usually end up managing:

  • A worker thread running the blocking behavior
  • A manager thread cancelling execution on timeout

Or you manually add timeout attributes across tests and hope nobody forgets one.

Either way, this becomes tedious and error-prone.

This is exactly the kind of infrastructure a test framework should handle by default.

Default test lifetimes​

Xcepto manages test lifetimes automatically:

  • Tests that complete early terminate immediately
  • Tests exceeding the timeout are forcefully terminated
  • Recent transition failures can be printed on timeout to jumpstart debugging

The result:

  • More resilient tests
  • Safer CI pipelines
  • Lower wasted compute costs
  • Faster debugging of deadlocks and blocking behavior

Originally published on themassiveone.net.