[erlang-questions] Cover compilation breaks running node

Roger Lipscombe roger@REDACTED
Mon Jun 3 17:04:46 CEST 2019


On Mon, 3 Jun 2019 at 15:46, Siri Hansen <erlangsiri@REDACTED> wrote:
> First, it is not possible to cover compile to file, so I guess compiling ahead of time is not straight forward.

Feature request for OTP-23? ;-)

> How do you start/stop your remote node?

In this particular case, the node is already running.

> When cover is started on a remote node, it loads the same cover compiled beam files as are running on the local node, so if your nodes are running different versions of your release, then you have a potential problem (e.g. function_clause and badrecords).

The node running ct_run is a separate node and isn't running the
release, per se, but I did use -pa to point ct_run at the release's
files.

It's cover-compiling the source/beam files from the release directory,
which was only just built, so I don't *think* this is the case...
Moreover, one of the affected modules is in the RabbitMQ AMQP client
library, which hasn't changed. Obviously, for efficiency, I should
probably exclude third party dependencies from cover-compilation, but
I'm still poking around and not at that stage yet.

> From the badarg with the ets table, it seems that you have cover compiled code running on the node without the cover server being running there (guessing the badarg means the table does not exist, that is). Is there any indication of the cover server crashing, or of unloading of cover compiled code failing?

I've closed the terminal window; I'll check again later.

> Does this happen early in the test run, or at the end of it? A problem I often see is that processes crash when cover is stopped. This has to do with code loading and occurs if a process is still running the old (non cover-compiled) code when cover is stopped.

The looping thing happens at the end of the test, but the test already
failed because of badrecord, etc., by this point.

> To avoid this, the cover_stop flag is added - see Code Coverage Analysis section in the user's guide.

I'll try this later and report back.



More information about the erlang-questions mailing list