-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ZTS: include microsecond timestamps on all output #17045
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
base: master
Are you sure you want to change the base?
Conversation
ed7589e
to
d0562f8
Compare
"03:04:46.89 [2025-02-16T03:04:46.898708]" looks duplicate and excessively verbose. I suspect you meant to add the timestamps in some places where they weren't, but seems now there are places when they are duplicate. And BTW, the CI seems very unhappy for some reason. |
d0562f8
to
4b62c60
Compare
This doesn't happen locally. Might be something in the CI runner adding timestamps? I'll look soon. |
@robn can you rebase this and see if that fixes the CI problems? |
4b62c60
to
a6d6ffa
Compare
Done. I did have a very short look and decided the extra bit might have been the CI proper, but I had no big ideas and haven't had time to get back to it properly yet. So lets see, either this will work or give me a new data point. Cheers :) |
If you need a reproducer - |
Yeah, while comparing the output of typeset out="$(log_must eval "zpool add -n '$TESTPOOL' $add" | \
sed /^SUCCESS/d)"
if [[ "$out" != "$want" ]]; then
log_fail "Got:\n" "$out" "\nbut expected:\n" "$want"
fi If the output of |
zfs/tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_dryrun_output.ksh Line 159 in dd2a46b
Just wondering if - sed /^SUCCESS/d)"
+ sed /.*SUCCESS/d)" would fix the test failure. |
Good find, thanks. I think I don't like that pattern - I don't like a test that is dependent on the output of the test framework it's running inside. There's only three instances in the whole test suite, so I'll rework them to just say what they mean. |
Yeah, agreed. At least I cleaned up my mess in #17198. |
a6d6ffa
to
92f6b69
Compare
Rebased onto #17198 and those three tests now pass. Pushed, lets see how it goes. |
92f6b69
to
f0a4068
Compare
When reviewing test output after a failure, it's often quite difficult to work out the order and timing of events, and to correlate test suite output with kernel logs. This adds timestamps to ZTS output to help with this, in three places: - all of the standard log_XXX functions ultimately end up in _printline, which now prefixes output with a timestamp. - the test runner logging function log() also now prefixes its output with a timestamp. - on failure, when capturing the kernel log in zfs_dmesg.ksh, the "iso" time format is requested. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris <[email protected]>
f0a4068
to
28af226
Compare
It is still somehow double-stamped in CI:
|
Forgot to mention, that I'm seeing the short timestamps as well. Seems not to be CI related. This is on a somewhat current
|
[Sponsors: Klara, Inc., Wasabi Technology, Inc.]
Motivation and Context
When reviewing test output after a failure, it's often quite difficult to work out the order and timing of events, and to correlate test suite output with kernel logs.
Description
This adds timestamps to ZTS output to help correlate events:
log_XXX
functions ultimately end up in_printline
, which now prefixes output with a timestamp.log()
also now prefixes its output with a timestamp.zfs_dmesg.ksh
, theiso
time format is requested. This is gated behind a platform check, as FreeBSD'sdmesg
has no switches to control timestamps.How Has This Been Tested?
Manually, running a test I know fails in my test VMs and considering the output.
(fyi, this test fails because the VM has no network support at all, not even a loopback. It's no big deal)
Types of changes
Checklist:
Signed-off-by
.