In integration tests, store drunc console output in a log file and check for warnings and errors - #162
Conversation
…nsole output to a log file.
…cking to log_file_checks.py
…ed pattern that matched a given logfile name was being checked instead of all patterns that matched the logfile name.
…e X11 forwarding setup failed for all app.
PawelPlesniak
left a comment
There was a problem hiding this comment.
Thank you for this PR @bieryAtFnal, I can confirm that the suggested implementation executed correctly using the suggested script. I have left some suggestions and questions on the PR, some for improvements, others for me to understand the structure more clearly. I hope this is useful.
| severity=match_logline_prefix.group(1) | ||
| if severity in ("WARNING", "ERROR", "FATAL"): | ||
| bad_line=True | ||
| #if not bad_line: |
| ) | ||
|
|
||
| # 21-Jul-2026, KAB: phrases that we always want to exclude | ||
| excluded_substring_map.setdefault("drunc", []).extend(["Substate.*In error.*Endpoint"]) |
There was a problem hiding this comment.
What is the movtivation for excluding the phrase "Endpoint" or "Substate" here?
|
|
||
| # 21-Jul-2026, KAB: phrases that we always want to exclude | ||
| excluded_substring_map.setdefault("drunc", []).extend(["Substate.*In error.*Endpoint"]) | ||
| excluded_substring_map.setdefault(r".*", []).extend(["X11 forwarding setup failed"]) |
There was a problem hiding this comment.
This issue should have been addressed by DUNE-DAQ/drunc#982, I would suggest removing it so we can keep track of whether this issue re-appears in the future
| proc_returncode = rc_process.returncode | ||
|
|
||
| # store the full dunerc console output in a log file for reference and checking | ||
| with open(f"{run_dir}/log_{getpass.getuser()}_drunc_console_output.txt", "w", encoding="utf-8") as ff: |
There was a problem hiding this comment.
This is exactly what is needed, but I suggest an extension here. Investigating the logfile, mani ANSI escape characters associated with the use of the rich output with color coding is including additional verbosity as
�[2;34m[2026/07/24 11:47:01 UTC]�[0m �[1;32mINFO �[0m �[2;37mshell.py:158 �[0m �[2;37mdrunc.unified_shell �[0m User pplesnia �[32mstarting the unified_shell�[0m
�[2;34m[2026/07/24 11:47:01 UTC]�[0m �[1;32mINFO �[0m �[2;37mshell.py:214 �[0m �[2;37mdrunc.unified_shell �[0m �[32mSetting up the SSH_SHELL process manager�[0m with configuration �[32mssh-standalone�[0m
�[2;34m[2026/07/24 11:47:01 UTC]�[0m �[1;32mINFO �[0m �[2;37mshell.py:231 �[0m �[2;37mdrunc.unified_shell �[0m Starting process manager
�[2;34m[2026/07/24 11:47:01 UTC]�[0m �[1;32mINFO �[0m �[2;37mprocess_manager.py:111 �[0m �[2;37mdrunc.process_manager �[0m process_manager communicating through address �[1;92m10.73.136.70�[0m�[1;32m:�[0m�[1;36m38319�[0m
�[2;34m[2026/07/24 11:47:01 UTC]�[0m �[1;32mINFO �[0m �[2;37mshell.py:291 �[0m �[2;37mdrunc.unified_shell �[0m Setting up the controller interface
There was a similar case of this when @emmuhamm overhauled the python logging framework, and the stripping of this was implemented in daqsystemtest in this PR. Would it be possible to implement this?
…drunc log file from integrationtest_drunc.py
…le_checks.py now that the underlying problem has been fixed.
PawelPlesniak
left a comment
There was a problem hiding this comment.
Thank you @bieryAtFnal, I have re-ran these tests and can confirm that the ANSI characters have been stripped out. The only remaining ones are in the various tables, but I think these should not be addressed until the duplicate nature of the table has been addressed, as you have listed in DUNE-DAQ/drunc#921.
I am interested in the selection of the exclusion line entries that I mentioned above, but this should not stop this PR from being merged.
|
Thanks, @PawelPlesniak , for checking that the special ANSI characters in the To respond to your other questions/suggestions:
That line has the word "error" in it, but it does not indicate a true error, of course. |
Description
Currently, in our integration test infrastructure, the
druncconsole output...However, there is no checking of this console output when determining whether the integtest passed or failed. The main goal of these changes is to add this checking.
My sense is that it would be great if we could use the same mechanism to allow some messages in the
druncconsole output to be ignored and others to be required when determining success or failure of the integtest, just like we do with messages in DAQ application log files. This led me to consider simply storing thedruncconsole output in a log file and doing the log-file-checking on it along with checking the existing log files. I can imagine that there might be other benefits of having thedruncconsole output in a log file (e.g. later reference), so I went ahead with that idea.The changes in this PR...
druncconsole in a log file (in the same location on disk as all of the other integtest log files)druncconsole output that have the word "error" in them but do not actually indicate an errorHere are sample instructions for testing these changes:
Type of change
Testing checklist
dunedaq_integtest_bundle.sh)Further checks