frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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•9mo ago

Comments

ashishb•9mo 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•9mo 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•9mo 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•9mo 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•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
Also known as deep monitoring: checking that functionality is available and working correctly.

Oil hits $100 a barrel despite deal to release record amount of reserves

https://www.bbc.com/news/articles/c1w5141vx53o
20•tartoran•56m ago•9 comments

Show HN: s@: decentralized social networking over static sites

http://satproto.org/
114•remywang•4h ago•41 comments

Temporal: The 9-year journey to fix time in JavaScript

https://bloomberg.github.io/js-blog/post/temporal/
571•robpalmer•12h ago•187 comments

Iran-Backed Hackers Claim Wiper Attack on Medtech Firm Stryker

https://krebsonsecurity.com/2026/03/iran-backed-hackers-claim-wiper-attack-on-medtech-firm-stryker/
13•2bluesc•1h ago•0 comments

Many SWE-bench-Passing PRs would not be merged

https://metr.org/notes/2026-03-10-many-swe-bench-passing-prs-would-not-be-merged-into-main/
176•mustaphah•7h ago•62 comments

Tested: How Many Times Can a DVD±RW Be Rewritten? Methodology and Results

https://goughlui.com/2026/03/07/tested-how-many-times-can-a-dvd%C2%B1rw-be-rewritten-part-2-metho...
76•giuliomagnifico•3d ago•7 comments

Making WebAssembly a first-class language on the Web

https://hacks.mozilla.org/2026/02/making-webassembly-a-first-class-language-on-the-web/
452•mikece•23h ago•159 comments

Don't post generated/AI-edited comments. HN is for conversation between humans

https://news.ycombinator.com/newsguidelines.html#generated
3055•usefulposter•9h ago•1155 comments

I was interviewed by an AI bot for a job

https://www.theverge.com/featured-video/892850/i-was-interviewed-by-an-ai-bot-for-a-job
201•speckx•10h ago•205 comments

Show HN: A context-aware permission guard for Claude Code

https://github.com/manuelschipper/nah/
61•schipperai•5h ago•31 comments

DHS Contracts Explorer – Hacked data from the Office of Industry Partnership

https://micahflee.github.io/ice-contracts/
196•peq42•2h ago•38 comments

Google closes deal to acquire Wiz

https://www.wiz.io/blog/google-closes-deal-to-acquire-wiz
251•aldarisbm•13h ago•162 comments

Show HN: I built a tool that watches webpages and exposes changes as RSS

https://sitespy.app
198•vkuprin•12h ago•49 comments

The MacBook Neo

https://daringfireball.net/2026/03/the_macbook_neo
451•etothet•16h ago•750 comments

About memory pressure, lock contention, and Data-oriented Design

https://mnt.io/articles/about-memory-pressure-lock-contention-and-data-oriented-design/
17•vinhnx•3d ago•0 comments

What Happens After You Die? (2016)

https://lamag.com/news/the-end/
6•NaOH•3d ago•1 comments

Entities enabling scientific fraud at scale (2025)

https://doi.org/10.1073/pnas.2420092122
270•peyton•15h ago•190 comments

BitNet: 100B Param 1-Bit model for local CPUs

https://github.com/microsoft/BitNet
318•redm•16h ago•159 comments

Challenging the Single-Responsibility Principle

https://kiss-and-solid.com/blog/keep-it-simple
11•WolfOliver•3d ago•8 comments

CNN Explainer – Learn Convolutional Neural Network in Your Browser (2020)

https://poloclub.github.io/cnn-explainer/
38•vismit2000•3d ago•2 comments

Meticulous (YC S21) is hiring to redefine software dev

https://jobs.ashbyhq.com/meticulous/3197ae3d-bb26-4750-9ed7-b830f640515e
1•Gabriel_h•7h ago

Show HN: Autoresearch@home

https://www.ensue-network.ai/autoresearch
50•austinbaggio•5h ago•10 comments

Show HN: Klaus – OpenClaw on a VM, batteries included

https://klausai.com/
132•robthompson2018•12h ago•69 comments

5,200 holes carved into a Peruvian mountain left by an ancient economy

https://newatlas.com/environment/5-200-holes-peruvian-mountain/
109•defrost•1d ago•54 comments

How much of HN is AI?

https://lcamtuf.substack.com/p/how-much-of-hn-is-ai
78•surprisetalk•3h ago•36 comments

Britain is ejecting hereditary nobles from Parliament after 700 years

https://apnews.com/article/uk-house-of-lords-hereditary-peers-expelled-535df8781dd01e8970acda1dca...
208•divbzero•7h ago•205 comments

Atlassian to cut roughly 1,600 jobs in pivot to AI

https://www.reuters.com/technology/atlassian-lay-off-about-1600-people-pivot-ai-2026-03-11/
154•jp0d•6h ago•221 comments

Swiss e-voting pilot can't count 2,048 ballots after decryption failure

https://www.theregister.com/2026/03/11/swiss_evote_usb_snafu/
175•jjgreen•15h ago•381 comments

Against vibes: When is a generative model useful

https://www.williamjbowman.com/blog/2026/03/05/against-vibes-when-is-a-generative-model-useful/
63•takira•1d ago•10 comments

Preliminary data from a longitudinal AI impact study

https://newsletter.getdx.com/p/ai-productivity-gains-are-10-not
39•donutshop•7h ago•30 comments