Skip to content
Merged
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
15 changes: 8 additions & 7 deletions linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"os"
"syscall"
"testing"
"time"
)

func TestMaintainMode(t *testing.T) {
Expand Down Expand Up @@ -115,9 +114,10 @@ func TestCompressMaintainMode(t *testing.T) {
err = l.Rotate()
isNil(err, t)

// we need to wait a little bit since the files get compressed on a different
// goroutine.
<-time.After(10 * time.Millisecond)
// Closing flushes the pending compression and waits for the mill
// goroutine to exit, which also synchronizes its writes with the
// assertions below.
isNil(l.Close(), t)

// a compressed version of the log file should now exist with the correct
// mode.
Expand Down Expand Up @@ -165,9 +165,10 @@ func TestCompressMaintainOwner(t *testing.T) {
err = l.Rotate()
isNil(err, t)

// we need to wait a little bit since the files get compressed on a different
// goroutine.
<-time.After(10 * time.Millisecond)
// Closing flushes the pending compression and waits for the mill
// goroutine to exit, which also synchronizes its writes to fakeFS with
// the assertions below.
isNil(l.Close(), t)

// a compressed version of the log file should now exist with the correct
// owner.
Expand Down
Loading