Quarkus Resiliency Testing brings dependency failures into application tests
The Quarkiverse extension exercises real Quarkus clients and configuration against controlled network, connection-pool, disk and DNS faults.
Quarkus developers can now test how an application behaves when its dependencies fail without replacing those dependencies with exception-throwing mocks. The new Quarkus Resiliency Testing extension redirects supported outbound connections through in-process proxies, allowing a @QuarkusTest to exercise the application's real clients, timeouts, retries and fallback configuration.
The distinction matters because production failures are not interchangeable. A service can accept a connection and stop answering, a payment can complete before its response is lost, or a database connection can die while an application is holding it. The extension provides targeted faults for those conditions and fails a test when no traffic reaches the selected proxy, helping guard against a test that points at the wrong dependency.
What the extension can exercise
The project's order-processing example applies faults to REST clients, PostgreSQL and Kafka. It checks that a hanging inventory service reaches a bounded fallback, that a bulkhead rejects excess callers promptly, and that the service recovers after the fault ends. For payments, it drops the first response after the provider has processed the charge, then verifies that retries reuse an idempotency key and do not charge the customer twice.
Database scenarios include a query that never answers, an exhausted connection pool, stale connections after recovery and a connection lost during a write. The examples pair the injected failures with application-level assertions: the HTTP status presented to the caller, whether a failed transaction left a row behind, and whether the next request works after recovery. Kafka tests similarly check that a failed synchronous publish rolls back the database transaction while noting that this design does not provide a distributed transaction; applications that need to accept work during broker outages require a pattern such as a transactional outbox.
The extension can also make supported Java file writes fail with a disk-full error, force DNS resolution failures, inject HTTP responses such as rate limits and interrupt streams. Its Dev UI integration lets developers apply faults interactively, inspect affected requests and turn the observation into a regression test. Dev MCP tools for AI-assisted test writing are opt-in in the Dev UI.
Boundaries and prerequisites
The published example uses version 0.6.0 of the test dependency and requires Quarkus 4 and Java 21. Network fault injection itself does not require a separate sidecar or container, although dependencies started through Dev Services can still require Docker.
The project also documents constraints: HTTP-level faults require plaintext HTTP/1.x, connectTimeout() is Linux-only, and support does not yet extend to every test mode or protocol. That makes the extension a focused test instrument rather than a replacement for load testing or end-to-end failure drills. Its practical value is narrower and useful: it gives Quarkus teams a repeatable way to prove what their own application does when a particular dependency hangs, disconnects or runs out of capacity.
sources
comments · 0