cmd/cue: deflake cue_after test
Currently there are two commands that are intended to run in sequence,
each of which sleep for a while, then print the time in unix
milliseconds. The test expects the two times to be different. Currently
the second command command sleep duration is 0ms, which means that if it
happens that the CUE logic runs in less than a millisecond, the test
will fail. The reason for the first sleep is almost certainly to provoke
a test failure if the second command doesn't wait for the first. So it
doesn't matter if it's quite a bit shorter than it currently is - the
only danger is a false negative. But the second sleep needs to be
non-zero to guarantee that the clock has advanced by at least some time.
Since this change makes the test take considerably less time, it seems
reasonable to remove the `-short` skipping.
Also, we can use `strconv.Atoi` which does arbitrary precision
int parsing as a slight simplification over `strconv.ParseInt`.
Also, make the output more useful if the test _does_ happen to flake
again by printing the actual values of the timestamps.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I3c01a3ea87a3638966f6ff2850cba77f5b113211
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1230088
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>