• 516052 (unregistered)

    What exactly is the purpose of a wait if you can't rely on it being correct in at least one direction? At that point it's basically just yield.

  • (nodebb)

    If you ask me to pick a language to develop something timing-sensitive you'd have to beat me repeatedly with a stick before I agree to use TS/JS.

  • 516052 (unregistered) in reply to AGlezB

    If you ask me to pick a language to develop something ~~timing-sensitive~~ you'd have to beat me repeatedly with a stick before I agree to use TS/JS.

    Fixed that for you.

  • 516052 (unregistered)

    Also, apparently ~~ does not work in quote tags. Great. I miss BBCode.

  • ttlanhil (unregistered) in reply to AGlezB

    To be fair... The code itself may well be sane, it's stuff in tests. I've had times where I want to load data into the database and then run code that queries it in a test harness (yeah, you can stub out most of the DB side of tests - tradeoffs...), and if you're looking at some sort of eventually-consistent DB then you may need to wait for a bit before querying. You rarely want to do too much of that in unit tests, but an integration test or two (particularly during deploy in CI/CD) to sanity test things can catch weird bugs

    Or you could be testing network timeouts or watchdog code - but that's hopefully a library rather than your general code

Leave a comment on “Wait Longer”

Log In or post as a guest

Replying to comment #702002:

« Return to Article