A slow, unstable API without touching the server
Chaos in Microkoi Bench delays responses, answers with server errors, drops connections and turns a fast network into 3G. You see whether the app shows a loading indicator and an error screen, whether timeouts and retries kick in, and whether an order goes through twice. No changes to the server or the app.
Your first rule in a minute
- 1
Create a profile
In “Traffic”, click “Chaos”, then “Create profile”. A profile is a set of rules for one condition, such as “Slow catalog”.
- 2
Pick endpoints
In the “Endpoints” tree, hover over a branch, click “⋯” and choose “Chaos”. The rule takes the branch’s host and path with everything inside.
- 3
Turn chaos on
Set a delay, errors, network failures or speed, and turn on “Apply chaos”. Changes take effect at once; there is no “Save” button.
The failures your users actually hit
Four blocks in every rule, each with its own probability from 1 to 100%.
Delay
Fixed or random, up to two minutes, for the response and separately for the request. You see whether the spinner keeps spinning and whether the user taps the button twice.
Server errors
500, 502, 503, 504, 429 or a custom code from 400 to 599, with a Retry-After header for 429 and 503. Before the server or after it.
Dropped connections
“Drop”, “Hang” until the app times out, and “Cut body” halfway through the response — to test how the app parses JSON that never fully arrived.
Slow network
Ready-made Edge, 3G, Slow 4G and Bad Wi‑Fi networks, or your own speeds in both directions and network latency.
On top of mocks and mock servers
Chaos applies to mock responses too. Each mock server has its own profile: one server runs steadily while the one next to it fails.
Runs and replays
Chaos is random but repeatable: the third request to a rule in a replayed run gets the same failure. A run code can be passed to a teammate.
How it works
Profiles and rules by endpoint
A rule picks requests by method, host and path with wildcards, as mocks do: * is one path segment, ** is any tail. If a request matches several rules, the most specific one applies, and among equally specific ones, the higher one in the list.
- Each rule in the list shows a summary of its enabled blocks, such as “2–5 s · 30%” or “503/500 · 20%”
- A rule from the endpoint tree: for a host it is
api.example.com/, for a branch the path with everything inside, for a method the exact request** - Profiles are files in the workspace’s
chaos/folder and reach your teammates through git, like mocks
Before the server or after
“Before server” means the request never reaches the server, so a retry is safe. “After server” means the server handles the request, yet the app still gets an error or a dropped connection. That is how you check whether a retry creates a second order.
- The error response is short, and its body shows that chaos produced it: “Microkoi Bench chaos: 503 Service Unavailable”
- For an error after the server, the exchange panel has a “Bench 503 / Server 201” toggle: the real server response is kept
- If both an error and a network failure fire, the failure wins: a dropped connection brings no status code
Slow network: Edge, 3G, Slow 4G, Bad Wi‑Fi
The “Speed” block delivers the response to the app and accepts the request at the speed of the chosen network, and adds network latency. Images and lists arrive in pieces, and the exchange time in traffic honestly grows.
- Edge — 30 KB/s to the app, 15 KB/s to the server, 500 ms
- 3G — 150 KB/s to the app, 50 KB/s to the server, 250 ms
- Slow 4G — 400 KB/s to the app, 100 KB/s to the server, 150 ms
- Bad Wi‑Fi — 125 KB/s to the app, 60 KB/s to the server, 200 ms
- Custom network — from 1 to 102,400 KB/s in each direction and latency up to 10 seconds
Chaos for mocks and mock servers
Bench treats a mock like a server: chaos delays add up with the mock’s delay, an error “after mock” spoils a response that is already prepared, and the mock’s own response is kept. In the list, such an exchange carries both marks — a lightning bolt in a blue square.
- Each mock server has its own “Chaos” button and its own profile, independent of “Traffic”
- A server with chaos on is marked with an orange lightning bolt in the server list
- Chaos leaves requests from the “Requests” section, monitoring and WebSockets alone
Runs: the same failure on the same request
Every time chaos is turned on, a run begins. The failure for the third request to a rule depends only on the run, the rule and the request number, so a random error can be repeated and a fix verified.
- “Start over” resets the request counters while chaos stays on
- “Replay run” in the exchange panel turns chaos on with that exchange’s profile and starts the run from request 1
- “Copy code” gives a code like K7Q2-9F3M, and “Replay from code…” reproduces the same failures on a teammate’s machine
- Bench keeps the last 50 runs on this computer, and the history does not go into git
You can see what chaos did
While chaos is on, the window title bar shows a “Chaos · Slow catalog” badge in every section, and the cross on it turns all chaos off at once. Bench always starts with chaos off, so a forgotten profile never spoils the next day’s work.
- An exchange hit by chaos is marked with a lightning bolt in the first column, and the error code or “drop” is shown in the chaos color
- A line above the response says what happened: “Response delayed by 2400 ms · Bench answered 502 · after server”
- The chaos delay is a separate “Chaos” phase on the exchange timing bar
- “Chaos” in the “Show only” group of “Filters” keeps exchanges hit by chaos, and “Without chaos” removes them from the list, history and tree
Questions and answers
Do I need to change the server or the app?
No. Chaos works in the Bench proxy: your app sends traffic through Bench, as in regular debugging, and the profile’s rules decide which exchanges to delay, break or slow down.
How is chaos different from a delay in a mock?
A mock sets the response itself, and its delay is constant. Chaos slows down and breaks real server responses, at random, with the probability you set. A slow but stable mock response is still configured in the mock itself.
Can chaos stay on by mistake?
No. Bench always starts with chaos off, and while it is on, the window title bar shows a badge with the profile name and a “Turn off” cross.
How do I reproduce an error that happened once?
Open the exchange where the app failed and click “Replay run”. Chaos starts the same run from request 1, and the same request to the rule gets the same failure. To share it, just send a teammate the run code.
What does chaos not affect?
Hosts that are not recorded, WebSockets, requests from the “Requests” section and monitoring. Mock servers have their own profile and their own switch. Time at a breakpoint is not chaos: the delay starts after the exchange is released.