Skip to content

Commit

Permalink
test: fix TestLogmon_Start_restart on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
  • Loading branch information
Juneezee committed May 3, 2022
1 parent b992a99 commit f910a73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/logmon/logmon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ func TestLogmon_Start_restart(t *testing.T) {
impl, ok := lm.(*logmonImpl)
require.True(ok)
require.NoError(lm.Start(cfg))
t.Cleanup(func() {
require.NoError(lm.Stop())
})

stdout, err := fifo.OpenWriter(stdoutFifoPath)
require.NoError(err)
Expand Down Expand Up @@ -250,8 +253,15 @@ func TestLogmon_Start_restart(t *testing.T) {

stdout, err = fifo.OpenWriter(stdoutFifoPath)
require.NoError(err)
t.Cleanup(func() {
require.NoError(stdout.Close())
})

stderr, err = fifo.OpenWriter(stderrFifoPath)
require.NoError(err)
t.Cleanup(func() {
require.NoError(stderr.Close())
})

_, err = stdout.Write([]byte("test\n"))
require.NoError(err)
Expand Down

0 comments on commit f910a73

Please sign in to comment.