mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
New partial-line test is flaking
...possibly because we somehow ended up with a two-line log file for a simple 'echo hi'? Make our timestamp-getting code safer by adding 'head -1'. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@ -398,16 +398,21 @@ $content--2.*" "logs --until -f on running container works"
|
|||||||
# Hand-craft a log file with partial lines and carriage returns
|
# Hand-craft a log file with partial lines and carriage returns
|
||||||
run_podman inspect --format '{{.HostConfig.LogConfig.Path}}' $cname
|
run_podman inspect --format '{{.HostConfig.LogConfig.Path}}' $cname
|
||||||
logpath="$output"
|
logpath="$output"
|
||||||
timestamp=$(awk '{print $1}' <"$logpath")
|
timestamp=$(head -n1 "$logpath" | awk '{print $1}')
|
||||||
cr=$'\r'
|
cr=$'\r'
|
||||||
nl=$'\n'
|
nl=$'\n'
|
||||||
cat >| $logpath <<EOF
|
# Delete, don't overwrite, in case conmon still has the fd open
|
||||||
|
rm -f $logpath
|
||||||
|
cat > $logpath <<EOF
|
||||||
$timestamp stdout F podman1$cr
|
$timestamp stdout F podman1$cr
|
||||||
$timestamp stdout P podman2
|
$timestamp stdout P podman2
|
||||||
$timestamp stdout F $cr
|
$timestamp stdout F $cr
|
||||||
$timestamp stdout F podman3$cr
|
$timestamp stdout F podman3$cr
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# FIXME: remove after 2024-01-01 if no more flakes seen.
|
||||||
|
cat -vET $logpath
|
||||||
|
|
||||||
expect1="podman3${cr}"
|
expect1="podman3${cr}"
|
||||||
expect2="podman2${cr}${nl}podman3${cr}"
|
expect2="podman2${cr}${nl}podman3${cr}"
|
||||||
expect3="podman1${cr}${nl}podman2${cr}${nl}podman3${cr}"
|
expect3="podman1${cr}${nl}podman2${cr}${nl}podman3${cr}"
|
||||||
|
Reference in New Issue
Block a user