From 3748088b96ecd59677655fc0c8f3f7d12eb8bda8 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Mon, 29 Dec 2014 14:38:00 -0800 Subject: [PATCH] etcdserver: print out log of normal tests --- etcdserver/server_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/etcdserver/server_test.go b/etcdserver/server_test.go index 9e6031d20..f057e0c92 100644 --- a/etcdserver/server_test.go +++ b/etcdserver/server_test.go @@ -23,6 +23,7 @@ import ( "log" "math/rand" "net/http" + "os" "path" "reflect" "strconv" @@ -41,10 +42,6 @@ import ( "github.com/coreos/etcd/store" ) -func init() { - log.SetOutput(ioutil.Discard) -} - // TestDoLocalAction tests requests which do not need to go through raft to be applied, // and are served through local data. func TestDoLocalAction(t *testing.T) { @@ -530,6 +527,9 @@ func (s *fakeTransporter) Pause() {} func (s *fakeTransporter) Resume() {} func testServer(t *testing.T, ns uint64) { + log.SetOutput(ioutil.Discard) + defer log.SetOutput(os.Stderr) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -1227,6 +1227,8 @@ func TestPublishStopped(t *testing.T) { // TestPublishRetry tests that publish will keep retry until success. func TestPublishRetry(t *testing.T) { + log.SetOutput(ioutil.Discard) + defer log.SetOutput(os.Stderr) n := &nodeRecorder{} srv := &EtcdServer{ node: n,