Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Edit: Someone on Reddit sent me a link to a method that can override the thread keep-alive duration. Its description makes it clear why the tasks were failing after exactly 10 seconds

> Yeah, testing if a task can run for 20 seconds isn’t great, but hey, at least it’s something

Well a reasonable thing to me is then to use the override within the test to shorten it (e.g. to 1s & use a 2s timeout).



Could be done, yeah, but 20s isn't that much, and I'd like to avoid adding more test-only magic environment variables zo configure this (our end-to-end tests are in Python and they use HQ as a binary).


I appreciate the sentiment, but I think it’s making the wrong pragmatism/purity tradeoff. The test is brittle - what happens when a future update of the dependency in a couple of years makes a change to the default timeout value? Aside from making test runs quicker which is good for anyone running the test suite without caring about this 1 test itself, it future proofs the test flakiness better against defaults changing out from under you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: