Add error message when failing to load DAQModule plugins - #365
Conversation
commonly happen during unit testing.
|
Possibly something in DUNE-DAQ/logging#45 |
bieryAtFnal
left a comment
There was a problem hiding this comment.
I confirm that I see the following message in the output from the appfwk unit tests when I use the code on this branch.
2026-Jun-30 10:57:36,136 ERROR [dunedaq::appfwk::make_module(...) at /home/nfs/biery/dunedaq/30JunFDDevLBIteratorTesting/sourcecode/appfwk/include/appfwk/detail/DAQModule.hxx:48] Failed to create DAQModule error_test of type not_a_real_plugin_name
IllegalUnderscore. Library specification "not_a_real_plugin_name" contains an illegal underscore.
Wait, this is really interesting! Apparently, the unit test has been testing the wrong thing all this time! The intent was to test trying to load a plugin type that doesn't exist, but apparently we've actually been testing an invalid plugin name format! |
|
I confirm that I now see two "new" error messages: and |
|
Hi all, I was thinking about this after the SWIT meeting yesterday. I think adding these additional messages is not the right way to address this. I believe the problem is this line here in ers https://github.com/DUNE-DAQ/ers/blob/fba16758987f04d5f62a669f85af3ef015369e2e/src/StandardStreamOutput.cpp#L139 as you can see when we have a stack of ERS::ISsues, we only print the first cause, while in fact we should print the whole stack. Can we try to address this first before overflowing our code with additional messages? I think this will make what we publish in the database more consistent with the content of our logs. I'm happy to have a chat about this if this is not clear. |
|
I don't think that is the problem; cause() is itself an ers::Issue, so that should recursively print the entire stack. The problem is that in the unit testing environment, the exception is caught by BOOST_REQUIRE_EXCEPTION, and the stdout print is never made. I do think this solution is pretty specific to this particular issue, since this code only is executed once per module per application, so that additional messages shouldn't be too much of a burden to deal with. |
Description
Add an ers::error report of DAQModuleCreationFailed to ensure output when running in unit tests.
Type of change
Testing checklist
dbt-build --unittest)pytest -s minimal_system_quick_test.py)dunedaq_integtest_bundle.sh)python -m pytest)pre-commit run --all-files)Comments here on the testing
Further checks
dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)(Indicate issue here: # (issue))