mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
test/e2e/certrefresh: Add file.Sync() to eliminate slow write failures. (#5033)
This commit eliminates the potential for a slow disk write to cause a test failure in the certificate rotation tests by adding a file `Sync()` call in the function used to copy certificate files around. Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
This commit is contained in:
@@ -155,7 +155,12 @@ func copy(from, to string) error {
|
||||
defer dst.Close()
|
||||
|
||||
_, err = io.Copy(dst, src)
|
||||
return err
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Ensure that our writes get committed to disk, even on slower systems.
|
||||
return dst.Sync()
|
||||
}
|
||||
|
||||
func getCert(t *testing.T) *x509.Certificate {
|
||||
|
||||
Reference in New Issue
Block a user