Notes
Feature flags
A feature flag separates deploying code from releasing a feature. The new code ships turned off, and a flag decides at run time who sees it: nobody, staff only, five percent of users, one region, or everyone. If something goes wrong, turning the flag off is a kill switch that works in seconds, without a new deploy. Flag tools include LaunchDarkly, Unleash and OpenFeature based libraries.
if (flags.isOn("freeship-coupon",
user)) {
// new coupon rules
} else {
// current rules
}
flag targets: off, staff only,
5% of users, a region, 100%
kill switch: off in seconds Testing flags
Testing flags means testing both sides. Flag off must keep the old behaviour, which is what most users see. Flag on gives the new behaviour. Test switching while a user is in the middle of checkout, and that targeting reaches only the right users. Tests should set the flag explicitly, through an API, configuration or an override, never depend on its current state. And push to remove old flags; each one doubles the paths to test.
- flag OFF: old behaviour still works (the default!)
- flag ON: new behaviour
- switching while a user is mid-checkout
- targeting: right users only tests set the flag explicitly (API, config, or override)
- remove old flags: each one doubles the paths
Canary releases
A canary release sends a small share of traffic, say five percent, to the new version, and compares its error rate and response times with the old one. If it is healthy, the share grows step by step to everyone; if it is worse, the platform rolls back automatically. Blue green keeps two complete environments and switches all traffic at once, so switching back is just as fast. Testers help define what healthy means.
- canary: new version gets 5% of traffic; compare error rate and latency with the old one → healthy: 25%, 50%, 100% → worse: automatic rollback
- blue-green: two full environments; switch traffic at once, switch back fast
Synthetic monitors
A synthetic monitor is a small automated test that runs against production every few minutes, often from several regions. Here it opens ShopRung, searches for mug and expects the two mugs; we ran it against ShopRung and it passed in under a second. Monitors stay read only, or use dedicated test accounts and data that are cleaned up. Alert after two failures in a row, not one, to avoid waking people for a single network hiccup. Checkly, Datadog and similar tools run Playwright scripts like this.
test("shop is usable", async
({ page }) => {
await page.goto("/");
const q = page.getByRole("searchbox");
await q.fill("mug");
await q.press("Enter");
await expect(page.getByRole(
"article")).toHaveCount(2);
});
// every 5 min; alert after 2 fails Smoke after deploy
Right after each deploy, a short smoke suite checks the new version is alive and usable. Does the health endpoint answer up, with the new version number? ShopRung's health endpoint returns its name and version, which is exactly what this check needs. Do the home page and search load? Can a test account log in and add to cart, without placing a real order? It should take under two minutes, and a failure stops the rollout.
- GET /api/health → UP and the NEW version number
- home page and search load
- log in with a test account
- add to cart (no order placed)
- under 2 minutes
- fail → stop the rollout or roll back
Observability
Observability is how you see inside production. Logs say what happened, searchable by request id. Metrics show rates and times, like the error rate, ninety fifth percentile latency, and orders per minute, a business signal that drops when checkout breaks. Traces follow one request across services. Error tracking groups new errors after a release. Testers who read these find bugs no test environment shows.
- logs: what happened, per request id
- metrics: error rate, latency p95, orders per minute
- traces: one request across services
- error tracking: new errors grouped (e.g. Sentry)
- dashboards + alerts
Safety rules
Rules that keep it safe. Never create real payments or orders, or make sure they are cancelled and refunded automatically. Mark test traffic with a header or dedicated test accounts, and exclude it from business analytics. Never run a load test against production without a plan and approval. Clean up test data. And never copy real customer data into tests or reports.
- never real payments or orders (or refund automatically)
- mark test traffic: header or test accounts, excluded from analytics
- no load tests without a plan and approval
- clean up test data
- no real customer data in tests
Common mistakes
Mistakes. Flags that are never removed, so nobody knows which paths are live. Testing only the flag on side. Monitors that alert on a single blip until people mute them. Monitors that place real orders. Test traffic counted in sales reports. And canary releases without a clear health rule, so nobody knows when to stop.
- flags never removed
- only testing flag ON
- monitors that alert on one blip (alert fatigue)
- monitors placing real orders
- test traffic counted as sales
- canary with no clear health rule
Say it like this
In the interview: carefully. Features ship behind flags, and we test both sides. Rollouts are canaries with automatic rollback when error rate or latency gets worse. A smoke suite runs after every deploy, and read only synthetic monitors run every few minutes from several regions. Test traffic is marked, we never place real orders, and every production bug becomes a new automated test.
- "Carefully. Features ship behind
- flags and we test both sides;
- rollouts are canaries with automatic rollback on error
- rate and latency. A smoke suite
- runs after each deploy, and read-only synthetic monitors run
- every few minutes. Test traffic
- is marked, no real orders, and production bugs become tests."