When I started testing LLM features, my first instinct was the one every automation engineer has: if a test is unstable, retry it. With a language model, that instinct is exactly wrong. The output is non-deterministic, so a test that passes on the second try has not proven anything. It has hidden the case where the model hallucinates one time in three.

So my harness runs with retries set to zero. A failure is data, not noise. Instead of asking "did this test pass?", the suite asks "how often does the model get this right?". Quality becomes a rate over 41 YAML test cases in six categories: functional, edge cases, hallucination, instruction following, safety and regression.

The assertions are layered. Deterministic checks come first, because they are cheap and never lie. Heuristics come next. An LLM judge comes last, and it fails closed: if the judge itself errors out or answers something unusable, the case fails instead of silently passing. A judge is a non-deterministic component too, and it needs guards like any other.

One more separation turned out to matter: infrastructure errors are not model failures. A timeout from the provider says nothing about whether the answer would have been correct, so the harness reports it apart and keeps it out of the quality rate.

In the end it is still ordinary testing: declarative data, layered assertions, metrics, and a gate in CI that blocks a release when the rates drop. The hard part is being strict with yourself and not letting a lucky green run count as a measurement.