frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Production tests: a guidebook for better systems and more sleep

https://martincapodici.com/2025/05/13/production-tests-a-guidebook-for-better-systems-and-more-sleep/
78•mcapodici•1y ago

Comments

ashishb•1y ago
Here's a general rule that I follow along with this and that is "write tests along the axis of minimum change"[1]. Such tests are more valuable and require less maintenance over time.

1 - https://ashishb.net/programming/bad-and-good-ways-to-write-a...

compumike•1y ago
I'd add that, in terms of tactical implementation, production tests can be implemented at least two different ways:

(1) You set up an outside service to send an HTTP response (or run a headless browser session) every minute, and your endpoint runs some internal assertions that everything looks good, and returns 200 on success.

(2) You set up a scheduled job to run every minute internal to your service. This job does some internal assertions that everything looks good, and sends a heartbeat to an outside service on success.

For #2: most apps of any complexity will already have some system for background and scheduled jobs, so #2 can make a lot of sense. It can also serve as a production assertion that your background job system (Sidekiq, Celery, Resque, crond, systemd, etc) is healthy and running! But it doesn't test the HTTP side of your stack at all.

For #1: it has the advantage that you also get to assert that all the layers between your user and your application are up and running: DNS, load balancers, SSL certificates, etc. But this means that on failure, it may be less immediately clear whether the failure is internal to your application, or somewhere else in the stack.

My personal take has been to lean toward #2 more heavily (lots of individual check jobs that run once per minute inside Sidekiq, and then check-in on success), but with a little bit of #1 sprinkled in as well (some lightweight health-check endpoints, others that do more intense checks on various parts of the system, a few that monitor various redirects like www->root domain or http->https). And for our team we implement both #1 and #2 with Heii On-Call https://heiioncall.com/ : for #2, sending heartbeats from the cron-style check jobs to the "Inbound Liveness" triggers, and for #1, implementing a bunch of "Outbound Probe" HTTP uptime checks with various assertions on the response headers etc.

And this production monitoring is all in addition to a ton of rspec and capybara tests that run in CI before a build gets deployed. In terms of effort or lines of code, it's probably:

    90% rspec and capybara tests that run on CI (not production tests)
    9% various SystemXyzCheckJob tests that run every minute in production and send a heartbeat
    1% various health check endpoints with different assertions that are hit externally in production
And absolutely agree about requiring multiple consecutive failures before an alarm! Whenever I'm woken up by a false positive, my default timeout (i.e. # of consecutive failures required) gets a little bit higher :)
hugs•1y ago
yeah, full end-to-end tests/monitors are like fire alarms: they can often tell you something is wrong, but not exactly what is wrong. but that doesn't mean fire alarms have no value. most common failure mode for teams are having too many or none at all. but having a few in a few key places is the way to go.
mhw•1y ago
The fabulous blazer gem includes a feature for #2: https://github.com/ankane/blazer?tab=readme-ov-file#checks - it’s limited to checks that can be expressed as SQL queries, but that can get you quite a way
aleksiy123•1y ago
At Google we call these probers.

Does anyone know of any tools/saas that do this.

Was thinking it may be a good potential product.

Especially if it was super easy to generate/spin up for side projects.

hugs•1y ago
"testing in production" can be controversial, but this is a well-balanced take on it.

lately i've been working on a decentralized production testing network called 'valet network' [1] (full-disclosure: selenium creator here)

i suspect production tests are the killer app for this kind of network: test any site on a real device from anywhere on idle devices that more closely match real world conditions, but as mentioned in the article, it's not that simple. dev users will still need to be smart about creating test data and filtering out the tests from system logs. i'm still in the "is this something people want?" learning phase, even though this is definitely something i want and wish i had when i was helping to fix healthcare.gov back in 2013/2014.

[1]: https://gist.github.com/hugs/7ba46b32d3a21945e08e78510224610...

vasusen•1y ago
Thank you for the balanced take on an extremely spicy topic.

At WePay (YC S09) we debated this extensively and came up with a similar middle of the way solution. Making sure that a credit card can get tokenized is the critical flow and should run every minute. We ended up with about 4-5 very quick production tests. They helped with debugging as well as alerting.

I am now building a full, automated testing solution at Donobu (https://www.donobu.com), and production tests definitely come up as their own subcategory of e2e tests. I am going to use your guidelines to refine our prompt and bound our production test generator.

testthetest•1y ago
> Running a test every minute, or 1440 times a day, will show up quite a lot in logs, metrics, and traces.

...not to mention that automated tests are by definition bot traffic, and websites do/should have protections against spam. Cloudflare or AWS WAF tends to filter out some of our AWS DeviceFarm tests, and running automated tests directly from EC2 instances is pretty much guaranteed to be caught by Captcha. Which is not a complaint: this is literally what they were designed to do.

A way to mitigate this issue is to implement "test-only" user agents or tokens to make sure that synthetic requests are distinguishable from real ones, but that means that our code does something in testing that it doesn't do in "real life". (The full Volkswagen effect.)

burnt-resistor•1y ago
Also known as deep monitoring: checking that functionality is available and working correctly.

AWS: Inaccurate Estimated Billing Data – $1.7 billion

451•nprateem•6h ago•291 comments

Mozilla: The state of open source AI

https://stateofopensource.ai/
122•rellem•1h ago•56 comments

Claude Code: Anatomy of a Misfeature

https://www.olafalders.com/2026/07/17/claude-code-anatomy-of-a-misfeature/
65•oalders•1h ago•29 comments

First atmosphere found on Earth-like planet in habitable zone of distant star

https://www.bbc.com/news/articles/cy4kdd1e0ejo
78•neversaydie•2h ago•62 comments

Show HN: Watch bots interact with an SSH honeypot in real time

https://honeypotlive.cc/
56•tusksm•2h ago•17 comments

AI Meets Cryptography 2: What AI Found in OpenVM's ZkVM

https://blog.zksecurity.xyz/posts/openvm-bugs/
33•duha•1h ago•0 comments

A Road to Lisp: Which Lisp

https://scotto.me/blog/2026-07-17-which-lisp/
54•silcoon•2h ago•17 comments

Three ways people respond to a problem (other than solving it)

https://improvesomething.today/responses-to-problems/
48•surprisetalk•2h ago•13 comments

Kimi K3, and what we can still learn from the pelican benchmark

https://simonwillison.net/2026/Jul/16/kimi-k3/
16•droidjj•1h ago•1 comments

Show HN: Explore the Workspaces of Modern Creators

https://workspaces.xyz/
10•ryangilbert•30m ago•7 comments

Multi-Primary Color Display Emerges as Next-Gen Color Reproduction Technology

https://en.ubiresearchnet.com/multi-primary-color-display-technology-2026/
46•ksec•3h ago•38 comments

Manufact (YC S25) Is Hiring a Senior infra engineer to build the MCP cloud

https://www.ycombinator.com/companies/manufact/jobs/Dh6PYP5-senior-infrastructure-engineer
1•luigipederzani•2h ago

EEG shows brain can simultaneous encode two speech streams

https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.3003876
206•giuliomagnifico•10h ago•129 comments

More Bounce to the Ounce

https://mceglowski.substack.com/p/more-bounce-to-the-ounce
26•pavel_lishin•2h ago•2 comments

Apple targets dozens of OpenAI employees with legal letters

https://www.ft.com/content/1b8c9d52-88a9-426b-ba47-f1811f859166
214•merksittich•4h ago•155 comments

Show HN: On-chain bond market where the issuers are AI agents

https://selbonds.now
9•griffinfoster7•1h ago•6 comments

PennyLane is an open-source quantum software platform for quantum

https://github.com/PennyLaneAI/pennylane
23•donutloop•2h ago•2 comments

VulnHunter: Capital One's agentic AI code security tool

https://www.capitalone.com/tech/open-source/announcing-vulnhunter/
26•medina•3h ago•16 comments

Pebble Mega Update – July 2026

https://repebble.com/blog/pebble-mega-update-july-2026
212•crazysaem•12h ago•117 comments

How Has Roman Concrete Lasted for Millennia? 1,900-Year-Old Latrine Offers Clues

https://www.smithsonianmag.com/smart-news/how-has-roman-concrete-lasted-for-millennia-a-1900-year...
218•divbzero•12h ago•169 comments

Show HN: Simulator for a custom 8-bit discreet logic computer

https://msap2.mehran.dk
3•mehrant•3d ago•0 comments

Microsoft Comic Chat is now open source

https://opensource.microsoft.com/blog/2026/07/16/microsoft-comic-chat-is-now-open-source/
756•jervant•1d ago•161 comments

Camera Chase Vehicle

https://transistor-man.com/gimbal_camera_rover.html
114•geerlingguy•1w ago•12 comments

Faster binary search: from compiled code to mechanical sympathy

https://pythonspeed.com/articles/branchless-binary-search/
22•enz•5d ago•8 comments

Tannakian Reconstruction

https://bartoszmilewski.com/2026/07/14/tannakian-reconstruction/
15•ibobev•3d ago•0 comments

Decoy Font

https://www.mixfont.com/experiments/decoy-font
644•ray__•23h ago•146 comments

Evidence of inconsistencies in evaluation process and selection of winners

https://www.kaggle.com/competitions/kaggle-measuring-agi/discussion/724918#3498423
395•twerkmeister•4h ago•238 comments

Kimi K3: Open Frontier Intelligence

https://www.kimi.com/blog/kimi-k3
1888•vincent_s•1d ago•1115 comments

An Engineer's Guide to USB Typе-С (2024)

https://www.ti.com/lit/eb/slyy228/slyy228.pdf?ts=1759892558029
252•gregsadetsky•6d ago•42 comments

$100 AI Music Video: Claude Fable 5 vs. GPT-5.6 Sol

https://www.tryai.dev/blog/ai-music-video-arena-claude-vs-gpt-5.6
347•hershyb_•20h ago•471 comments