1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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>
This commit is contained in:
Sebastiaan van Stijn 2021-09-21 14:33:01 +02:00
parent 040b1d5eeb
commit e7583ab859
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -262,6 +262,7 @@ func (d *Daemon) LogFileName() string {
// ReadLogFile returns the content of the daemon log file // ReadLogFile returns the content of the daemon log file
func (d *Daemon) ReadLogFile() ([]byte, error) { func (d *Daemon) ReadLogFile() ([]byte, error) {
_ = d.logFile.Sync()
return os.ReadFile(d.logFile.Name()) return os.ReadFile(d.logFile.Name())
} }