test(outputs.remotefile): Make test more robust (#16676)
This commit is contained in:
parent
beaca2885e
commit
61d9c80aaf
|
|
@ -474,8 +474,12 @@ func TestTrackingMetrics(t *testing.T) {
|
||||||
require.NoError(t, plugin.Connect())
|
require.NoError(t, plugin.Connect())
|
||||||
defer plugin.Close()
|
defer plugin.Close()
|
||||||
|
|
||||||
// Write the metrics and wait for the data to settle to disk
|
// Write the input metrics and close the plugin. This is required to
|
||||||
|
// actually flush the data to disk
|
||||||
require.NoError(t, plugin.Write(input))
|
require.NoError(t, plugin.Write(input))
|
||||||
|
plugin.Close()
|
||||||
|
|
||||||
|
// Wait for the data to settle to disk
|
||||||
require.Eventually(t, func() bool {
|
require.Eventually(t, func() bool {
|
||||||
ok := true
|
ok := true
|
||||||
for fn := range expected {
|
for fn := range expected {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue