Skip to content

Commit 9645fb1

Browse files
committed
Make parallel-ct properly detect test failures
The problem comes from `ct_master` which doesn't tell us in the return value whether the tests succeeded. In order to get that information a CT hook was created. But then we run into another problem: despite its documentation claiming otherwise, `ct_master` does not handle `ct_hooks` instructions in the test spec. So for the time being we fork `ct_master` into a new `ct_master_fork` module and insert our hook directly in the code. Later on we will submit patches to OTP.
1 parent 3540541 commit 9645fb1

File tree

4 files changed

+1011
-4
lines changed

4 files changed

+1011
-4
lines changed

deps/rabbit/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,22 @@ define ct_master.erl
239239
peer:call(Pid2, persistent_term, put, [rabbit_ct_tcp_port_base, 25000]),
240240
peer:call(Pid3, persistent_term, put, [rabbit_ct_tcp_port_base, 27000]),
241241
peer:call(Pid4, persistent_term, put, [rabbit_ct_tcp_port_base, 29000]),
242-
ct_master:run("$1"),
242+
ct_master_fork:run("$1"),
243+
Fail1 = peer:call(Pid1, cth_parallel_ct_detect_failure, has_failures, []),
244+
Fail2 = peer:call(Pid2, cth_parallel_ct_detect_failure, has_failures, []),
245+
Fail3 = peer:call(Pid3, cth_parallel_ct_detect_failure, has_failures, []),
246+
Fail4 = peer:call(Pid4, cth_parallel_ct_detect_failure, has_failures, []),
243247
peer:stop(Pid4),
244248
peer:stop(Pid3),
245249
peer:stop(Pid2),
246250
peer:stop(Pid1),
247-
halt()
251+
if
252+
Fail1 -> halt(1);
253+
Fail2 -> halt(2);
254+
Fail3 -> halt(3);
255+
Fail4 -> halt(4);
256+
true -> halt(0)
257+
end
248258
endef
249259

250260
PARALLEL_CT_SET_1_A = amqp_client unit_cluster_formation_locking_mocks unit_cluster_formation_sort_nodes unit_collections unit_config_value_encryption unit_connection_tracking

0 commit comments

Comments
 (0)