-
Notifications
You must be signed in to change notification settings - Fork 4k
Run rabbit_ct_hook before cth_styledout so that removing default logger handler works #13947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…er properly removed As a follow-up to my GChat thread about removing default logger handler to clean CT stdout, I was looking at injecting logger config with undefined default handler to ct_run. It is possible but breaks cth_styledout - no nice green things whatsoever. Then I found rabbit_ct_hook which calls redirect_logger_to_ct_logs which in turn calls logger:remove_handler(default) apparently with zero effect! To cut story short - turned out rabbit_ct_hook must run before cth_styledout for remove_handler line to have any effect
|
@michaelklishin It works for individual suites, but not for parallel - too much magic. I can add |
|
@ikavgo I certainly find this output an improvement. We can start with the core ( |
|
Fine with me. |
|
Looks good to me as well. |
|
cool, I will add to rabbit_common, management and mqtt. @lhoguin any hints on parallel suites? It looks like it has this "inplace" ct_master right inside the Makefile =). I feel like I plug CT_OPTS somewhere here, but not sure where still... |
|
Options need to be converted to their Erlang term equivalent and given to CT from the Erlang script in the Makefile. Not sure about the details. |
|
I added crude support for parallel test (ct_master is forked anyway), and replaces some ct:pals with ct:log. Before: https://github.com/rabbitmq/rabbitmq-server/actions/runs/15240078576/job/42860845449#step:9:13156 |
Helps cleaning-up/coloring stdout for parallel targets TODO: there are obvious races for different nodes outputs In the next iteration I hope to implement cursor tracking for each node
|
I gave up on rabbit_ct_hook for rabbit_common. ct_helpers depend on rabbit_common and it is all sorts of ugliness |
|
@ikavgo no worries, we can leave |
|
It is green, finally. If looks good, I think I'll add to the rest of the deps and if you are flying I can merge. Thoughts? |
|
Thank you, @ikavgo. |
As a follow-up to my GChat thread about removing default logger handler to clean CT stdout, I was looking at
injecting logger config with undefined default handler to
ct_run. It is possible but breakscth_styledout- no nice green things whatsoever. Then I foundrabbit_ct_hookwhich calls redirect_logger_to_ct_logs which in turn callslogger:remove_handler(default)apparently with zero effect! To cut story short - turned outrabbit_ct_hookmust run beforecth_styledoutforremove_handlerline to have any effect.Doesn't work for parallel targets yet -
rabbitmq-server/deps/rabbit/Makefile
Line 227 in 77477de
make -C deps/rabbit ct-<>it really shines.