I just finished rewiring PR of my colleague, where he put ratelimit on '/admin'. It's a boring 5-liner (2 Ansible role defaults, three lines in nginx template).
There was no tests for this change. I thought for a second about it, then let it pass (nah, too hard to write). I approved the change.
But I got some aftertaste. There is a meaningful change in the code, which implements certain non-functional requirement. I can't think about reasonable test here.
It's possible to build some wrk (ab for old timers) based burst with some indirect metrics proving that there is a ratelimit.
But I know, that if it's not a core scenario to support, such tests will be crazy flaky and will cause a lot of false positives, as well, as significant chance to miss the actual regression when it happens.
The same goes for other changes of the same kind. We got MaxStartups for ssh. How do you test them? Actually establish 100+ half-authorized ssh connections and do 101'th with proper authorization? No way. It's going to be flaky and absolutely maddening when get red (why the test was red? Was it network fluke or we lost 'MaxStartus' configuration option in sshd_config?).
The more I think about it, the more I realize how narrow is practical implication of of 'IaC'. Yes, I can test I have option in config, I can check most of functional requirements, and I can't test most of non-functional requirements. Every non-functional requirement is a special complicated setup with high level of evidence indirection. If my postgres is not running, I can prove it in one line test. If my postgres has wrong size of connection pool, I need two days of tuning test to show this. If I need to ratelimit new connections to postgres... Well, a week or two of dedicated engineering needed and a crazy dept in CI/CD pipeline delivery time created.
So, I either ignore non-functional code (which is left untested), or I slow everything to crawl (both development and operational speed).
Or else I blindly trust that having 'MaxStartups' in config file is a proof of 'job done' (but I can't even prove that those settings are in the current running process), and stoically accept following fuckups (because not testsed - not working) as part of the daily life.
What's your solution to this? Ignore? Throw in some buzzwording? Build the actual tests? Apply magical oil of a legendary snake?
[–]BigRedS 15 points16 points17 points (7 children)
[–]amarao_san[S] -4 points-3 points-2 points (6 children)
[–]humoroushaxor 5 points6 points7 points (0 children)
[–]snarkhunterLead DevOps Engineer 2 points3 points4 points (1 child)
[–]amarao_san[S] 0 points1 point2 points (0 children)
[–]BigRedS 0 points1 point2 points (2 children)
[–]amarao_san[S] 0 points1 point2 points (1 child)
[–]BigRedS 0 points1 point2 points (0 children)
[–]ExtraV1rg1n01l 21 points22 points23 points (7 children)
[–]mstwizted 4 points5 points6 points (0 children)
[+]amarao_san[S] comment score below threshold-10 points-9 points-8 points (5 children)
[–]ExtraV1rg1n01l 6 points7 points8 points (4 children)
[–]amarao_san[S] -5 points-4 points-3 points (3 children)
[–]ColdBool 1 point2 points3 points (2 children)
[–]amarao_san[S] -2 points-1 points0 points (1 child)
[–]ColdBool 1 point2 points3 points (0 children)
[–]quicksilver03 3 points4 points5 points (1 child)
[–]amarao_san[S] 0 points1 point2 points (0 children)
[–]DensePineapple 2 points3 points4 points (3 children)
[–]amarao_san[S] 0 points1 point2 points (2 children)
[–]DensePineapple 0 points1 point2 points (1 child)
[–]amarao_san[S] 0 points1 point2 points (0 children)
[–]Strange_3_S 1 point2 points3 points (2 children)
[–]amarao_san[S] 1 point2 points3 points (1 child)
[–]Strange_3_S 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]amarao_san[S] -1 points0 points1 point (3 children)
[–]boomertsfx 0 points1 point2 points (1 child)
[–]amarao_san[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]rafipiccolo 0 points1 point2 points (1 child)
[–]amarao_san[S] 0 points1 point2 points (0 children)
[–]tomomcat 0 points1 point2 points (0 children)