Skip to content

Commit

Permalink
try upping wait interval when reading entries
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryFissionGames committed Feb 18, 2022
1 parent 4677b2b commit 08644fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion operator/builtin/input/file/rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ type rotationTest struct {
writeInterval time.Duration
pollInterval time.Duration
ephemeralLines bool
waitInterval time.Duration
}

/*
Expand Down Expand Up @@ -259,7 +260,7 @@ func (rt rotationTest) run(tc rotationTest, copyTruncate, sequential bool) func(
select {
case e := <-logReceived:
received = append(received, e.Record.(string))
case <-time.After(100 * time.Millisecond):
case <-time.After(tc.waitInterval):
break LOOP
}
}
Expand All @@ -286,6 +287,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
},
{
name: "Fast/NoDeletion",
Expand All @@ -294,6 +296,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
},
{
name: "Fast/Deletion",
Expand All @@ -302,6 +305,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
ephemeralLines: true,
},
{
Expand All @@ -311,6 +315,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
ephemeralLines: true,
},
{
Expand All @@ -320,6 +325,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: 3 * time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
},
{
name: "Slow/NoDeletion",
Expand All @@ -328,6 +334,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: 3 * time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
},
{
name: "Slow/Deletion",
Expand All @@ -336,6 +343,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 1,
writeInterval: 3 * time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
},
{
name: "Slow/Deletion/ExceedFingerprint",
Expand All @@ -344,6 +352,7 @@ func TestRotation(t *testing.T) {
maxBackupFiles: 2,
writeInterval: 3 * time.Millisecond,
pollInterval: 10 * time.Millisecond,
waitInterval: 500 * time.Millisecond,
},
}

Expand Down

0 comments on commit 08644fc

Please sign in to comment.