[erlang-questions] Know if running in CT

Roberto Ostinelli roberto@REDACTED
Thu Dec 10 18:52:48 CET 2015

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.

BTW this is exactly what I'm doing right now.


On Thu, Dec 10, 2015 at 5:18 PM, Jesper Louis Andersen <
jesper.louis.andersen@REDACTED> wrote:

> On Thu, Dec 10, 2015 at 5:10 PM, Roberto Ostinelli <roberto@REDACTED>
> wrote:
>> Ideally, I would like to define a conditional macro depending on code
>> running in tests or not.
> You can probably have a configuration option via application:get_env/2 you
> can use to make the discrimination. On the top of my head, this is what I
> would do.
>> Any ideas welcome!
> Advice: don't do it. Keep your test artifact equivalent to the deployment
> artifact. Make the application such that normal configuration parameters
> can be set in order to make the application work in the test environment.
> It is safer in the long run because you don't want too many diverging code
> paths based on the environment it lives in. It is simply too brittle, and
> that would be my advice.
> --
> J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151210/7eeef76c/attachment.htm>

More information about the erlang-questions mailing list