On 12/1/26 16:40, Christian Couder wrote:
>
> People might not know they need diagnostics as a script waiting on the
> lock looks just like a slow EXPENSIVE test. And, when using `-v`, the
> output is around 20 times (60 times if `-x` is also used) more verbose
> than without it, so there are good reasons not to use `-v`.
>
> Also under `prove`, `-v` is not even allowed ("verbose mode forbidden
> under TAP harness; try --verbose-log"), and not sure a lot of people
> use `--verbose-log` with it.
>
Got it.
>>> With Meson, or when running scripts or `prove` directly, nothing
>>> cleans test-results/. So a lock left behind by SIGKILL (including the
>>> OOM killer) can still be there days later. The same PID could then be
>>> reused by a long-running process of the same user. This would result
>>> in the script silently waiting forever.
>>>
>>> In such a case, printing something even if `-v` or `--verbose-log` is
>>> not used, would likely make it much easier to understand what's going
>>> on.
>>>
>>> So I would suggest sending this message, as well as the "running
>>> anyway" and "removing stale" messages, to stderr instead. There are
>>> only a few dozen EXPENSIVE tests, so this should not add much output.
>>> The subtests in 2/2 that go through the stale lock removal would then
>>> need to expect that message on stderr though.
>>>
>>> The message would also help even more if it included the holder's PID,
>>> for example like "waiting for EXPENSIVE lock held by PID 1234".
>>>
>>
>> Okay. I guess sending to stderr doesn't do us much harm either. I'll
>> prefix it with a '#' to ensure it doesn't interfere with TAP.
>
> Great, but don't TAP parsers only read stdout? If sending to stderr, a
> '#' might not be needed.
>
TAP parsers do read only stdout, but with --tee or --verbose-log test-lib merges the script's stderr into stdout, so these lines reach the TAP stream. That's also why the existing -x warning in t/test-lib.sh has the '#'. It keeps them valid TAP comments.
--
Sivaraam