[MM-36411] Fix flaky TestUpdateConfigDiffInAuditRecord (#17777)

* Fix flaky test

* Force log flush only
This commit is contained in:
Claudio Costa
2021-06-14 16:42:09 +02:00
committed by GitHub
parent 2ffcec3b5b
commit 0ae307808a
+5
View File
@@ -4,6 +4,7 @@
package api4
import (
"context"
"fmt"
"io/ioutil"
"net/http"
@@ -470,6 +471,10 @@ func TestUpdateConfigDiffInAuditRecord(t *testing.T) {
})
require.Equal(t, timeoutVal+1, *cfg.ServiceSettings.ReadTimeout)
// Forcing a flush before attempting to read log's content.
err = th.Server.Log.Flush(context.Background())
require.NoError(t, err)
data, err := ioutil.ReadAll(logFile)
require.NoError(t, err)
require.NotEmpty(t, data)