Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Disable flaky windows file rotation tests #16332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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