mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-21 14:20:41 +08:00
Fix flaky test (#16874)
This commit is contained in:
+6
-1
@@ -927,7 +927,12 @@ func TestFileStoreWatcherEmitter(t *testing.T) {
|
||||
cfgData, err := config.MarshalConfig(minimalConfig)
|
||||
require.NoError(t, err)
|
||||
|
||||
ioutil.WriteFile(path, cfgData, 0644)
|
||||
f, err := os.OpenFile(path, os.O_WRONLY, 0644)
|
||||
require.NoError(t, err)
|
||||
defer f.Close()
|
||||
_, err = f.Write(cfgData)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.True(t, wasCalled(called, 5*time.Second), "callback should have been called when config written")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user