diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2021-09-21 14:33:01 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2021-10-27 12:39:06 +0200 |
commit | e7583ab8593ddfdd1f26ad201dc43edf52896bf2 (patch) | |
tree | 7e25d92bc1d1394eb55dd98ef3954c360f88737b /testutil | |
parent | 040b1d5eebc263437ad4bd69fb73398ee5153d84 (diff) | |
download | docker-e7583ab8593ddfdd1f26ad201dc43edf52896bf2.tar.gz |
testutil/daemon: ReadLogFile() trigger os.Sync() before reading
Make sure it's written to disk before we try reading the logs.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'testutil')
-rw-r--r-- | testutil/daemon/daemon.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/testutil/daemon/daemon.go b/testutil/daemon/daemon.go index fe12063169..775db6b4ac 100644 --- a/testutil/daemon/daemon.go +++ b/testutil/daemon/daemon.go @@ -262,6 +262,7 @@ func (d *Daemon) LogFileName() string { // ReadLogFile returns the content of the daemon log file func (d *Daemon) ReadLogFile() ([]byte, error) { + _ = d.logFile.Sync() return os.ReadFile(d.logFile.Name()) } |