From 142aa067ec5129cb99026a9a3e93f8213995b22d Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Thu, 27 Aug 2015 15:25:24 +0000 Subject: [PATCH] Fix test --- probe/docker/container.go | 2 +- probe/docker/container_linux_test.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/probe/docker/container.go b/probe/docker/container.go index 42bee395d..aa384ec46 100644 --- a/probe/docker/container.go +++ b/probe/docker/container.go @@ -222,7 +222,7 @@ func (c *container) GetNodeMetadata() report.NodeMetadata { return result } - result.Merge(report.MakeNodeMetadataWith(map[string]string{ + result = result.Merge(report.MakeNodeMetadataWith(map[string]string{ NetworkRxDropped: strconv.FormatUint(c.latestStats.Network.RxDropped, 10), NetworkRxBytes: strconv.FormatUint(c.latestStats.Network.RxBytes, 10), NetworkRxErrors: strconv.FormatUint(c.latestStats.Network.RxErrors, 10), diff --git a/probe/docker/container_linux_test.go b/probe/docker/container_linux_test.go index ce8349a90..18f604ae3 100644 --- a/probe/docker/container_linux_test.go +++ b/probe/docker/container_linux_test.go @@ -8,7 +8,6 @@ import ( "log" "net" "net/http" - "runtime" "testing" "time" @@ -55,7 +54,6 @@ func TestContainer(t *testing.T) { t.Errorf("%v", err) } defer c.StopGatheringStats() - runtime.Gosched() // wait for StartGatheringStats goroutine to call connection.Do // Send some stats to the docker container stats := &client.Stats{} @@ -65,7 +63,7 @@ func TestContainer(t *testing.T) { } // Now see if we go them - test.Poll(t, 10*time.Millisecond, "12345", func() interface{} { + test.Poll(t, 100*time.Millisecond, "12345", func() interface{} { return c.GetNodeMetadata().Metadata[docker.MemoryUsage] }) }