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

Comments

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

Pgbackrest is no longer being maintained

https://github.com/pgbackrest/pgbackrest
55•c0l0•39m ago•9 comments

Flipdiscs

https://flipdisc.io
325•skogstokig•3d ago•56 comments

Fully Featured Audio DSP Firmware for the Raspberry Pi Pico

https://github.com/WeebLabs/DSPi
27•BoingBoomTschak•1d ago•4 comments

I bought Friendster for $30k – Here's what I'm doing with it

https://ca98am79.medium.com/i-bought-friendster-for-30k-heres-what-i-m-doing-with-it-d5e8ddb3991d
866•ca98am79•14h ago•436 comments

TurboQuant: A first-principles walkthrough

https://arkaung.github.io/interactive-turboquant/
181•kweezar•9h ago•40 comments

AI should elevate your thinking, not replace it

https://www.koshyjohn.com/blog/ai-should-elevate-your-thinking-not-replace-it/
543•koshyjohn•15h ago•397 comments

Self-updating screenshots

https://interblah.net/self-updating-screenshots
333•bjhess•1d ago•49 comments

The Prompt API

https://developer.chrome.com/docs/ai/prompt-api
150•gslin•9h ago•82 comments

It's OK to abandon your side-project (2024)

https://robbowen.digital/wrote-about/abandoned-side-projects/
97•hisamafahri•3h ago•44 comments

Rust Memory Management: Ownership vs. Reference Counting

https://slicker.me/rust/ownership_and_borrowing_vs_reference_counting.html
30•vinhnx•2d ago•10 comments

Three constraints before I build anything

https://jordanlord.co.uk/blog/3-constraints/
234•nervous_north•1d ago•40 comments

Fast16: High-precision software sabotage 5 years before Stuxnet

https://www.sentinelone.com/labs/fast16-mystery-shadowbrokers-reference-reveals-high-precision-so...
274•dd23•15h ago•56 comments

Bob Odenkirk would like to remind you that life is a meaningless farce

https://www.nytimes.com/2026/04/25/magazine/bob-odenkirk-interview.html
75•wslh•22h ago•61 comments

A Guide to CubeSat Mission and Bus Design

https://pressbooks-dev.oer.hawaii.edu/epet302/
38•o4c•1d ago•2 comments

When the cheap one is the cool one

https://arun.is/blog/cheap-cool/
137•ddrmaxgt37•1d ago•72 comments

Moleskine's AI Lord of the Rings collection can only mock

https://cjleo.com/blog/moleskine-ai-lord-of-the-rings-collection-can-only-mock/
5•lentil_soup•2h ago•0 comments

SWE-bench Verified no longer measures frontier coding capabilities

https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified/
316•kmdupree•21h ago•170 comments

Box to save memory in Rust

https://dystroy.org/blog/box-to-save-memory/
138•emschwartz•3d ago•39 comments

Electrostatics and High Voltage Links

http://amasci.com/static/electrostatic1.html
9•ludicrousdispla•3d ago•1 comments

Branimir Lambov from IBM on Cassandra

https://theconsensus.dev/p/2026/04/26/branimir-lambov-from-ibm-on-cassandra.html
3•eatonphil•21h ago•0 comments

Sawe becomes first athlete to run a sub-two-hour marathon in a competitive race

https://www.bbc.com/sport/athletics/articles/crm1m7e0zwzo
417•berkeleyjunk•14h ago•277 comments

Mystery Cpuid Bit

http://www.os2museum.com/wp/mystery-cpuid-bit/
19•userbinator•2d ago•2 comments

FreeBSD Device Drivers Book

https://github.com/ebrandi/FDD-book
93•myth_drannon•12h ago•18 comments

The Mushroom That Makes People Have the Exact Same Hallucination

https://www.vice.com/en/article/meet-the-mushroom-that-make-people-have-the-exact-same-hallucinat...
59•thunderbong•4h ago•41 comments

EvanFlow – A TDD driven feedback loop for Claude Code

https://github.com/evanklem/evanflow
76•evanklem2004•9h ago•35 comments

Quirks of Human Anatomy

https://www.sdbonline.org/sites/fly/lewheldquirk/figlegq6.htm
139•gurjeet•2d ago•78 comments

An AI agent deleted our production database. The agent's confession is below

https://twitter.com/lifeof_jer/status/2048103471019434248
727•jeremyccrane•19h ago•867 comments

Magic: The Gathering took me from N2 to Japanese fluency

https://www.tokyodev.com/articles/how-magic-the-gathering-took-me-from-n2-to-japanese-fluency
141•pwim•3d ago•64 comments

Chernobyl wildlife forty years on

https://www.bbc.com/future/article/20260424-chernobyl-wildlife-forty-years-on
117•reconnecting•15h ago•66 comments

Butterflies are in decline across North America, a look at the Western Monarch

https://www.smithsonianmag.com/science-nature/butterflies-are-in-dramatic-decline-across-north-am...
217•1659447091•14h ago•68 comments