[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-time] FW: POSIX output should not start with "Command exited wi
From: |
Petr Pisar |
Subject: |
Re: [Bug-time] FW: POSIX output should not start with "Command exited with non-zero status" line |
Date: |
Thu, 9 Nov 2017 12:03:24 +0100 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Wed, Nov 08, 2017 at 02:34:55PM -0700, Assaf Gordon wrote:
> Petr Pisar wrote:
> > I think the first line should not be here when POSIX mode is request
> > with the -p option. POSIX says:
> [...]
> > In the previous 1.7 release, Fedora patched time to report the command
> > failure only if -v option was specified, so that "time -p" also did not
> > report it.
>
> Thanks for the suggestion.
> Pushed here:
> https://git.savannah.gnu.org/cgit/time.git/commit/?id=c5e97663
>
Great. The only issue is the newly added test fails randomly with:
FAIL: tests/time-posix-quiet
============================
--- out-default 2017-11-09 11:50:52.642813091 +0100
+++ exp-default 2017-11-09 11:50:52.635813098 +0100
@@ -1,3 +1,3 @@
Command exited with non-zero status
-user system :elapsed %CPU (avgtext+avgdata maxresident)k
+user system :elapsed ?%CPU (avgtext+avgdata maxresident)k
inputs+outputs (major+minor)pagefaults swaps
--- out-q 2017-11-09 11:50:52.652813081 +0100
+++ exp-q 2017-11-09 11:50:52.646813087 +0100
@@ -1,2 +1,2 @@
-user system :elapsed %CPU (avgtext+avgdata maxresident)k
+user system :elapsed ?%CPU (avgtext+avgdata maxresident)k
inputs+outputs (major+minor)pagefaults swaps
FAIL tests/time-posix-quiet.sh (exit status: 1)
Maybe it's because time reports randomly 0%CPU and 100%CPU:
$ ./time false
Command exited with non-zero status 1
0.00user 0.00system 0:00.00elapsed 100%CPU (0avgtext+0avgdata 1208maxresident)k
0inputs+0outputs (0major+64minor)pagefaults 0swaps
$ ./time false
Command exited with non-zero status 1
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 1180maxresident)k
0inputs+0outputs (0major+62minor)pagefaults 0swaps
But I cannot understand what the quotation mark in the expected output means.
Is it a glob? Or a regular expression, or a literal character? time-1.7 used
to report "?" if it could not compute the value to elide a divison by zero.
This is what I see on your vanilla code.
In addition, Fedora applies a patch
<https://src.fedoraproject.org/rpms/time/blob/master/f/time-1.8-Recompute-CPU-usage-at-microsecond-level.patch>
that lowers the posibility of a bogus value by computing on microsecond level.
With the patch, the test seems to fail always.
-- Petr
signature.asc
Description: PGP signature