test(outputs.remotefile): Make test more robust (#16676)

This commit is contained in:
Sven Rebhan 2025-03-24 14:20:27 +01:00 committed by GitHub
parent beaca2885e
commit 61d9c80aaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -474,8 +474,12 @@ func TestTrackingMetrics(t *testing.T) {
require.NoError(t, plugin.Connect())
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))
plugin.Close()
// Wait for the data to settle to disk
require.Eventually(t, func() bool {
ok := true
for fn := range expected {