mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-17 03:24:40 -07:00
Merge pull request #511 from nats-io/suppress_write_deadline_parsing_warning_in_test
Updated test to suppress stdout output
This commit is contained in:
@@ -683,6 +683,13 @@ func TestParseWriteDeadline(t *testing.T) {
|
||||
t.Fatalf("Expected write_deadline to be 1s, got %v", opts.WriteDeadline)
|
||||
}
|
||||
os.Remove(confFile)
|
||||
oldStdout := os.Stdout
|
||||
_, w, _ := os.Pipe()
|
||||
defer func() {
|
||||
w.Close()
|
||||
os.Stdout = oldStdout
|
||||
}()
|
||||
os.Stdout = w
|
||||
if err := ioutil.WriteFile(confFile, []byte("write_deadline: 2\n"), 0666); err != nil {
|
||||
t.Fatalf("Error writing config file: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user