From 61d9c80aaf5b0450a29aec4ce0a6e185a0331d34 Mon Sep 17 00:00:00 2001 From: Sven Rebhan <36194019+srebhan@users.noreply.github.com> Date: Mon, 24 Mar 2025 14:20:27 +0100 Subject: [PATCH] test(outputs.remotefile): Make test more robust (#16676) --- plugins/outputs/remotefile/remotefile_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/outputs/remotefile/remotefile_test.go b/plugins/outputs/remotefile/remotefile_test.go index 681c5e3a6..a890459dc 100644 --- a/plugins/outputs/remotefile/remotefile_test.go +++ b/plugins/outputs/remotefile/remotefile_test.go @@ -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 {