1. 3

  2. 2

    I find this applies everywhere, not just Erlang: always prefer aggressive polling to sleeping in tests. It’s especially common to see this in code that waits for ports to be open/closed, or affects the filesystem. To the extent that it should be a common lint to detect and warn about any sleep in tests, since it’s so often the first remedy people try. If your test wastes a bunch of CPU polling in a loop, who cares? It’s much better than slowing down the test suite by an arbitrary amount.