diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-09-09 11:07:07 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-09-12 18:05:11 +0200 |
commit | c5bdb6afe741d34c32f779b6ef9508b6f1d05794 (patch) | |
tree | addc0b3a2b657e4fc4cd6de80f067f19c63609fc /test/system | |
parent | 5abc08df252037e2984a2b532f17ba78fdd876d4 (diff) | |
download | podman-c5bdb6afe741d34c32f779b6ef9508b6f1d05794.tar.gz podman-c5bdb6afe741d34c32f779b6ef9508b6f1d05794.tar.bz2 podman-c5bdb6afe741d34c32f779b6ef9508b6f1d05794.zip |
fix hang with podman events file logger
podman --events-backend file events --stream=false should never hang. The
problem is that our tail library will wait for the file to be created
which makes sense when we do not run with --stream=false. To fix this we
can just always create the file when the logger is initialized. This
would also help to report errors early on in case the file is not
accessible.
Fixes part one from #15688
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/090-events.bats | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/system/090-events.bats b/test/system/090-events.bats index cd1bf327b..51a327865 100644 --- a/test/system/090-events.bats +++ b/test/system/090-events.bats @@ -147,7 +147,6 @@ function _populate_events_file() { # Config without a limit eventsFile=$PODMAN_TMPDIR/events.txt - _populate_events_file $eventsFile containersConf=$PODMAN_TMPDIR/containers.conf cat >$containersConf <<EOF [engine] @@ -155,6 +154,11 @@ events_logger="file" events_logfile_path="$eventsFile" EOF + # Check that a non existing event file does not cause a hang (#15688) + CONTAINERS_CONF=$containersConf run_podman events --stream=false + + _populate_events_file $eventsFile + # Create events *without* a limit and make sure that it has not been # rotated/truncated. contentBefore=$(head -n100 $eventsFile) |