Skip to content

Commit

Permalink
[pkg/stanza] Skipping flaky test case `TestExcludeOlderThanFilter/exc…
Browse files Browse the repository at this point in the history
…lude_some_files` on Windows (open-telemetry#32848)

**Description:** <Describe what has changed.>
This PR skips the test case
`TestExcludeOlderThanFilter/exclude_some_files` only on Windows because
it appears to be flaky there.

**Link to tracking Issue:** <Issue number if applicable>

open-telemetry#32838
  • Loading branch information
ycombinator committed May 3, 2024
1 parent 2ace496 commit f584d29
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/stanza/fileconsumer/matcher/internal/filter/exclude_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ func TestExcludeOlderThanFilter(t *testing.T) {
expect []string
expectedErr string
expectedWindowsErr string

// List of OSes on which to skip this test case
skipOS []string
skipReason string
}{
"no_files": {
files: []string{},
Expand All @@ -43,6 +47,9 @@ func TestExcludeOlderThanFilter(t *testing.T) {
expectedErr: "",
},
"exclude_some_files": {
skipOS: []string{"windows"},
skipReason: "Flaky test case on Windows: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32838",

files: []string{"a.log", "b.log"},
fileMTimes: []time.Time{twoHoursAgo, threeHoursAgo},
excludeOlderThan: 3 * time.Hour,
Expand Down Expand Up @@ -71,6 +78,12 @@ func TestExcludeOlderThanFilter(t *testing.T) {

for name, tc := range cases {
t.Run(name, func(t *testing.T) {
for _, os := range tc.skipOS {
if runtime.GOOS == os {
t.Skipf("Skipping test case: %s", tc.skipReason)
}
}

tmpDir := t.TempDir()
var items []*item
// Create files with specified mtime
Expand Down

0 comments on commit f584d29

Please sign in to comment.