[erlang-questions] Know if running in CT

Roger Lipscombe roger@REDACTED
Thu Dec 10 18:57:55 CET 2015


On 10 December 2015 at 17:52, Roberto Ostinelli <roberto@REDACTED> wrote:
> Thank you Jesper,
> I *very* rarely do it. However, I'm in need to slow down a node to allow for
> distributed tests to work.

IntervalMs = application:get_env(?APPLICATION, furtle_interval_ms, 10).

Because you never know when you'll need to change the furtling
interval in production.

But, if you're needing to slow things down to allow distributed tests
to work, you've got a race condition, and sleeps (effectively) are a
band-aid. You should be waiting for (whatever) to finish before moving
on. We do this, mostly, by repeated polling and, occasionally, by
waiting for events.

Unless you're deliberately inducing race conditions and _that's_ why
you need the slowness, of course...



More information about the erlang-questions mailing list