Skip to content

Commit

Permalink
Avoid race with watch notifications in test.
Browse files Browse the repository at this point in the history
We're not able to handle duplicate watcher notifications yet.
  • Loading branch information
jaqx0r committed Oct 13, 2020
1 parent 4241569 commit 8a57510
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/mtail/multiple_levels_directory_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"path"
"sync"
"testing"
"time"

"github.com/google/mtail/internal/mtail"
"github.com/google/mtail/internal/testutil"
Expand All @@ -27,8 +26,8 @@ func TestPollLogPathPatterns(t *testing.T) {
testutil.FatalIfErr(t, os.Mkdir(progDir, 0700))
defer testutil.TestChdir(t, logDir)()

// only polling
m, stopM := mtail.TestStartServer(t, 10*time.Millisecond, false, mtail.ProgramPath(progDir), mtail.LogPathPatterns(logDir+"/files/*/log/*log"))
// only manual polling -- zero for poll duration to avoid duplicates in test.
m, stopM := mtail.TestStartServer(t, 0, false, mtail.ProgramPath(progDir), mtail.LogPathPatterns(logDir+"/files/*/log/*log"))
defer stopM()

logCountCheck := m.ExpectMetricDeltaWithDeadline("log_count", 1)
Expand Down

0 comments on commit 8a57510

Please sign in to comment.