73% Winner Probability Confirmed ... Consider rolling out aa_copy
Both arms run exactly the same code. The 95% interval is [-17.4%, +32.7%], which includes 0. Config Lab: no winner.
Track 1 · Test Something Real · Toggle Wars
Config Lab tests a timeout and retry policy for a service dependency with a Flagsmith experiment, then applies a written ship rule that says ship, do not ship, or inconclusive.
For the backend or on-call engineer who has to choose a client timeout and retry setting and wants evidence instead of a guess.
$ SESSIONS=150 SESSIONS_AA=150 SESSIONS_SLOW=150 \
SUFFIX=-q OWN_STACK=1 ./run.sh
Needs Docker, curl and Python 3.10+. The first start also pulls images, so it takes longer on a slow network. A check of the path, not evidence. The full-size run takes about 21 minutes.
The problem
Say a dependency has been failing in short bursts. Someone proposes a 300 ms timeout with one retry instead of the current 1000 ms and none. It sounds sensible. A canary looks fine. Whether it helps depends on how the dependency fails, and that is the thing nobody measured.
Putting the change behind a Flagsmith experiment gives you numbers. Flagsmith's experiment banner can still mislead if you read it as a verdict. In these runs it was wrong twice.
The product, as it ran
These are the recorded screens, taken on 29 Nov 2026 from Flagsmith 2.295.2 and the lab dashboard. The traffic behind every screen is simulated. Click an image to open it full size.
tools/ship.py shipped the winner.How it works
A small service calls a flaky dependency. Its timeout and retry policy sits behind a Flagsmith multivariate flag. A load script drives scripted sessions through it. Flagsmith serves the variants, collects the metrics and computes the statistics. The dashboard applies the ship rule.
session-N and makes 5 requests.dependency_policy flag once from Flagsmith, which records the exposure.timeout_ms and retries; the stub misbehaves as healthy, slow or flaky.One multivariate flag, dependency_policy, split 50/50. The identity is session-<n> and the flag is read once per session.
timeout_ms=1000,retries=0timeout_ms=300,retries=1timeout_ms=500,retries=2patient_retry was run on the slow profile only. If Flagsmith is down, the service serves a hard-coded policy and the session joins no experiment.
Enforced by the dashboard. All of these must hold:
The 5-point bar and the guardrail test were written before the first runs. The interval check and the 100-identity floor were added on 28 Nov after review.
Fixed before any run. The stub injects errors and delays from a seeded random generator.
Measured on the stub, 400 calls each: flaky gave 17.8% 503 and 9.8% slow calls; healthy p50 48 ms, p95 65 ms.
| Flagsmith feature | What the code does | Where |
|---|---|---|
| Multivariate flag | dependency_policy carries the timeout and retry policy as its value. | tools/setup_experiment.py |
| Experimentation (self-hosted) | Creates an experiment per run with metrics, starts it, refreshes and reads its results. | tools/setup_experiment.py, tools/read_results.py, docker-compose.yml |
| Experiment metrics | Four metrics with direction and expected direction. | tools/setup_experiment.py |
Python SDK get_experiment_flag | Reads the variant once per session; this records the exposure. | src/service/session.py |
Python SDK track_event | Sends the conversion events per identity. | src/service/session.py, src/loadgen/run.py |
| Identities | One identity per session. | src/loadgen/run.py |
| Rollout and completion API | Ships the winner, ends on control, or only raises the rollout. | tools/ship.py |
| Admin REST API | Bootstraps organisation, project and environments; the dashboard reads results. | tools/bootstrap.py, src/lab/server.py |
| Fallback when Flagsmith is down | Serves the hard-coded policy, sends no events. Tested: 30 of 30 sessions fell back correctly. | src/service/session.py |
Results
Simulated All runs use simulated load on one machine against a seeded stub. The service really waits, times out and retries against a running HTTP dependency, so latency and retry counts are measured. The fault profiles are my own models, not measurements of a real dependency.
Session success rate, control (ring) to variant (dot).
| Run | Sessions | Result (simulated) |
|---|---|---|
| A/A on flaky | 1000 + 40 pilot | No winner. Lift +0.003, 95% interval [-0.130, +0.135], chance to win 0.515. |
| A/B on flaky | 2000 | Supported. Success 44.7% to 72.5% (+27.8 points), interval +49% to +75% relative. Mean latency 108 to 79 ms. Cost: 1.26 extra dependency calls per session. |
| A/B on healthy | 2000 | Inconclusive. Both arms 100% success, 0 retries, 43 ms. The zero-width interval comes from zero variance, not from precision. |
| A/B on slow | 600 | Refuted: do not ship. Success 100% to 81.2%, interval [-0.231, -0.144]. Mean latency fell 199 to 113 ms, but a 300 ms timeout aborts calls that would have finished in 600-900 ms. |
| A/B on slow, patient_retry | 600 | As predicted, do not ship. Success 100% to 95.1%. 21.1% of patient_retry sessions were slow (over 1000 ms) vs 0% for control. |
Full size, all five runs, on a fresh stack each time. Same direction every time: flaky 41.9% to 73.6% and 43.8% to 72.4% (ship), slow 100% to 78.6% and 79.7% (do not ship).
For fast_retry on slow I wrote down that success would not drop. The run refuted that. I predicted the patient_retry result correctly.
The three profiles are models, so the numbers are specific to this lab. The decision rule is the part to reuse. Which profile you are in is the thing to measure first.
Use fast_retry (300 ms timeout, 1 retry) only where the dependency fails fast and intermittently. Do not use it where the dependency is merely slow: success fell about 19 points, and the gentler patient_retry still fell 5 points with 21% slow sessions. Expect no gain where the dependency is healthy.
What it does not do
Run it
Run them from the project folder. Needs Docker, curl and Python 3.10+. On macOS the default 3.9 is too old: brew install python@3.11. No .env is needed. Step-by-step guide for a first run.
$ ./run.sh test
$ SESSIONS=150 SESSIONS_AA=150 SESSIONS_SLOW=150 \
SUFFIX=-q OWN_STACK=1 ./run.sh
$ OWN_STACK=1 ./run.sh
The full run starts its own Flagsmith with Docker, then serves the lab dashboard at http://localhost:8411 (Flagsmith UI: http://localhost:8401). Stub on 8409. Override ports with DEP_PORT, DASH_PORT, FS_PORT.
None measured on a quiet machine. The first start also pulls images and runs migrations, which depends on your network.
38 unit tests (20 in tests/test_core.py, 18 in tests/test_service.py) that need no running Flagsmith. They cover policy parsing, fault-profile rates, the policy runner against a real in-process stub, session logic with a fake Flagsmith client, and the dashboard's verdict rules. The path through a real Flagsmith is covered by tools/smoke.py and the runs, not by unit tests. There is no CI.
Point the load script at a URL with --target; each session's five requests go there with the policy Flagsmith served. Set the policy to use when the flag is missing with CONFIG_LAB_FALLBACK. This has not been run against any service other than the stub.