Explorar el Código

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>
Sebastiaan van Stijn hace 3 años
padre
commit
e7583ab859
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      testutil/daemon/daemon.go

+ 1 - 0
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())
 }