runtests: support buffering log messages in runner & servers

Log messages generated with logmsg can now be buffered and returned from
the runner as a return value.  This will be needed with parallel testing
to allow all messages for one test to be displayed together instead of
interspersed with messages of multiple tests. Buffering can be disabled
by setting a logging callback function with setlogfunc, which is
currently being done to preserve existing logging behaviour for now.

Some additional output is generated in verbose and debugprotocol modes,
which don't always use logmsg. These modes also impact some servers
which generate extra messages. No attempt is made to buffer everything
if these modes are enabled.

Ref: #10818
Closes #11016
This commit is contained in:
Dan Fandrich 2023-04-21 14:07:31 -07:00
parent c3453dcb9d
commit 189f9e23b6
5 changed files with 100 additions and 33 deletions

View file

@ -59,6 +59,9 @@ use runner qw(
readtestkeywords
singletest_preprocess
);
use testutil qw(
setlogfunc
);
use getpart;
@ -119,6 +122,7 @@ sub init_protocols {
# Initialize the test harness to run tests
#
sub init_tests {
setlogfunc(\&logmsg);
init_protocols();
initserverconfig();
}