mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
[MM-36411] Fix flaky TestUpdateConfigDiffInAuditRecord (#17777)
* Fix flaky test * Force log flush only
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user