test(inputs.syslog): Add timeout to closed socket test (#15461)

This commit is contained in:
Joshua Powers 2024-06-05 15:38:06 -06:00 committed by GitHub
parent 3e03f0aa10
commit 079c9d285a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 6 deletions

View File

@ -287,15 +287,13 @@ func TestCases(t *testing.T) {
} }
func TestSocketClosed(t *testing.T) { func TestSocketClosed(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping test as very flaky on Windows")
}
// Setup the plugin // Setup the plugin
plugin := &Syslog{ plugin := &Syslog{
Address: "tcp://127.0.0.1:0", Address: "tcp://127.0.0.1:0",
Config: socket.Config{}, Config: socket.Config{
Log: testutil.Logger{}, ReadTimeout: config.Duration(10 * time.Millisecond),
},
Log: testutil.Logger{},
} }
require.NoError(t, plugin.Init()) require.NoError(t, plugin.Init())