Skip to content

Commit

Permalink
[chore] Disable flaky windows file rotation tests (open-telemetry#16332)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored and shalper2 committed Dec 6, 2022
1 parent 6c4be08 commit 1a50c17
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/stanza/fileconsumer/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strconv"
"sync"
"testing"
Expand Down Expand Up @@ -466,6 +467,9 @@ func TestStartAtEnd(t *testing.T) {
// a file created after the operator has been started is read from the
// beginning
func TestStartAtEndNewFile(t *testing.T) {
if runtime.GOOS != windowsOS {
t.Skip("Rotation tests have been flaky on Windows. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16331")
}
t.Parallel()

tempDir := t.TempDir()
Expand Down
15 changes: 15 additions & 0 deletions pkg/stanza/fileconsumer/rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ func TestMultiFileRotateSlow(t *testing.T) {
}

func TestMultiCopyTruncateSlow(t *testing.T) {
if runtime.GOOS != windowsOS {
t.Skip("Rotation tests have been flaky on Windows. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16331")
}
tempDir := t.TempDir()
cfg := NewConfig().includeDir(tempDir)
cfg.StartAt = "beginning"
Expand Down Expand Up @@ -305,6 +308,9 @@ func (rt rotationTest) run(tc rotationTest, copyTruncate, sequential bool) func(
}

func TestRotation(t *testing.T) {
if runtime.GOOS != windowsOS {
t.Skip("Rotation tests have been flaky on Windows. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16331")
}
cases := []rotationTest{
{
name: "NoRotation",
Expand Down Expand Up @@ -471,6 +477,9 @@ func TestTrackRotatedFilesLogOrder(t *testing.T) {
// TruncateThenWrite tests that, after a file has been truncated,
// any new writes are picked up
func TestTruncateThenWrite(t *testing.T) {
if runtime.GOOS != windowsOS {
t.Skip("Rotation tests have been flaky on Windows. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16331")
}
t.Parallel()

tempDir := t.TempDir()
Expand Down Expand Up @@ -505,6 +514,9 @@ func TestTruncateThenWrite(t *testing.T) {
// we get the unread logs on the copy as well as any new logs
// written to the truncated file
func TestCopyTruncateWriteBoth(t *testing.T) {
if runtime.GOOS != windowsOS {
t.Skip("Rotation tests have been flaky on Windows. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16331")
}
t.Parallel()

tempDir := t.TempDir()
Expand Down Expand Up @@ -545,6 +557,9 @@ func TestCopyTruncateWriteBoth(t *testing.T) {
}

func TestFileMovedWhileOff_BigFiles(t *testing.T) {
if runtime.GOOS != windowsOS {
t.Skip("Rotation tests have been flaky on Windows. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16331")
}
t.Parallel()

tempDir := t.TempDir()
Expand Down

0 comments on commit 1a50c17

Please sign in to comment.