Skip to content

Commit e7583ab

Browse files
committed
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>
1 parent 040b1d5 commit e7583ab

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

testutil/daemon/daemon.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ func (d *Daemon) LogFileName() string {
262262

263263
// ReadLogFile returns the content of the daemon log file
264264
func (d *Daemon) ReadLogFile() ([]byte, error) {
265+
_ = d.logFile.Sync()
265266
return os.ReadFile(d.logFile.Name())
266267
}
267268

0 commit comments

Comments
 (0)