On 25/05/2022 00:33, ISHIKAWA,chiaki wrote:
Hi,

I am running TB test suite (mochitest) locally and have an issue at the format of the timestamp of the log lines.
I am not sure when the time stamp became this way.
(I don't think I had this issue several years ago. Something must have changed a year or so ago? Maybe around the time, mochitest replaced mozmill test.)

Can we modify the test suite run script so that the timestamp prepended to the log line always has a filled two digits leading number, 0-filled if necessary, WITHOUT leading space character?

Currently: the log lines when the leading number of the timestamp is one digit, they look like the following. Note the space character at the beginning of the line. This causes a problem for simple-minded log summarizer.

  0:23.46 INFO runtests.py | Waiting for browser...
 0:49.50 GECKO(735766) #01: NS_DebugBreak (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:497)  0:49.50 GECKO(735766) #02: nsWindow::SetZIndex(int) (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/widget/gtk/nsWindow.cpp:2470)  0:49.50 GECKO(735766) #03: UpdateNativeWidgetZIndexes(nsView*, int) (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/view/nsView.cpp:505)

I would like it to be: Note there is no leading space character.

00:23.46 INFO runtests.py | Waiting for browser...
00:49.50 GECKO(735766) #01: NS_DebugBreak (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:497) 00:49.50 GECKO(735766) #02: nsWindow::SetZIndex(int) (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/widget/gtk/nsWindow.cpp:2470) 00:49.50 GECKO(735766) #03: UpdateNativeWidgetZIndexes(nsView*, int) (/NEW-SSD/NREF-COMM-CENTRAL/mozilla/view/nsView.cpp:505)

This formatting would make it much easier for me to create a script to pick up interesting lines and calculate
the counts from the log.

Try changing %2d to %02d in the format_seconds function at
https://searchfox.org/mozilla-central/rev/9902932742fcdce2c956eeb81fd38350f5394ab2/testing/mozbase/mozlog/mozlog/formatters/machformatter.py#37-40

Hope this helps,

JK

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/677b1d6c-d177-0339-fa2e-9de642188d17%40gmail.com.

Reply via email to