rebar3 icon indicating copy to clipboard operation
rebar3 copied to clipboard

CT hook cth_surefire enabled hides reason for init_per_suite crash

Open tsloughter opened this issue 4 years ago • 6 comments

This may be a bug in cth_surefire in OTP and not with rebar3 but it needs investigation.

If the hook is configured to be used:

{ct_opts, [{ct_hooks, [cth_surefire]}]}

And a crash happens in init_per_suite of a suite the logs you get from rebar3 are just:

"cth_surefire:pre_init_per_suite/3 CTH call failed"

Removing the hook results in the actual cause of the crash to be printed by rebar3.

tsloughter avatar Aug 17 '19 15:08 tsloughter

So another wrinkle.

It will continue to fail, even if the suite's init_per_suite is fixed, until _build/test is deleted! So while there still may be something about the initial failure and rebar3 not giving the actual init_per_suite failure, it is definitely an issue with whatever state cth_surefire loads from previous runs as well.

tsloughter avatar Aug 17 '19 16:08 tsloughter

Yeah that seems to point to the hook itself having a bug. That kind of error message is what I'd get in cth_readable whenever I messed up some log handling and things would blow up.

ferd avatar Aug 18 '19 21:08 ferd

On rebar 3.14.1 it returns

init_per_suite: FAILED
%%% ams_SUITE ==> {thrown,a}

I find no reference to CTH in the logs. It's either fixed or I'm doing something wrong to try and replicate it.

paulo-ferraz-oliveira avatar Sep 15 '20 01:09 paulo-ferraz-oliveira

I this is not something we can fix, just something we can track as it has to do with how CT hooks themselves handle their lifecycle.

ferd avatar Sep 15 '20 12:09 ferd

I think I am having the same issue, any progress on the issue?

Falsen avatar Nov 27 '22 14:11 Falsen

Nope. This issue, last time I saw it, came from enabling the maybe expressions in the compiler but not in the VM (need to set ERL_FLAGS="-enable-feature all"), and random modules not being loadable by common test. It's something rather outside of our control.

ferd avatar Nov 27 '22 15:11 ferd