util: genElapsedTime parses the timing line wherever it sits on the line - #4554
Merged
maliberty merged 2 commits intoSep 26, 2026
Merged
Conversation
genElapsedTime.py writes the per-stage summary, the only place ORFS
reports a hash of a stage's result. It read the elapsed time
positionally: strip the line, delete "Elapsed time: ", split on "[h:]",
on the first "." and on ":". That works only when the timing line starts
the log line. Give it a prefix, as a RUN_CMD wrapper that stamps log
lines does ("[ 123.45] "), and the prefix survives the delete, the
split on "." cuts at the prefix's own decimal point, and the line falls
to "Elapsed time not understood". The row is then skipped: elapsed,
peak memory and the sha1sum column vanish, "No elapsed time found" does
not fire because the line was found, and the exit status is 0.
Match the timing line with a regex anchored on its format instead,
hours optional as run_command.py only emits them past an hour. An
unprefixed line gives exactly the number it did before, fraction of a
second dropped as before, and an unparseable line still reaches "not
understood".
test_genElapsedTime_parses_output asserted only that the stage name
appeared, which it does even when the row is dropped; it now asserts
the elapsed and memory columns. Two cases are added: a prefixed line,
which fails before this change, and the hours form.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the elapsed time parsing logic in genElapsedTime.py to use a regular expression, allowing it to robustly parse timing lines that contain prefixes or optional hour fields. Additionally, corresponding unit tests have been added in test_run_command.py to verify these parsing capabilities. There are no review comments, and I have no feedback to provide.
Member
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline. |
maliberty
approved these changes
Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
genElapsedTime.pywrites the per-stage summary row: elapsed time, peak memory and the sha1sum of the stage's results, the one place ORFS reports a hash of a stage's result. It parsed the timing line positionally, so a timing line with any prefix is "not understood" and the whole row is dropped silently: no "No elapsed time found" warning (the line was found), exit status 0. ARUN_CMDwrapper that stamps log lines ([ 123.45] Elapsed time: ...) is enough to trigger it.Fix
Match the timing line with a regex anchored on its format, hours optional as
run_command.pyonly emits them past an hour. An unprefixed line gives exactly the number it did before (fraction of a second dropped as before), and an unparseable line still reaches "Elapsed time not understood".Test
flow/test/test_run_command.py:test_genElapsedTime_parses_outputasserted only that the stage name appeared, which it does even when the row is dropped; it now asserts the elapsed and memory columns.flow/test/*.pyall pass; black clean.🤖 Generated with Claude Code