mirror of
https://github.com/weaveworks/scope.git
synced 2026-05-05 08:48:51 +00:00
Add -cpu 4 to tests.
This commit is contained in:
@@ -8,9 +8,12 @@ import (
|
||||
"net/http"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
client "github.com/fsouza/go-dockerclient"
|
||||
|
||||
"github.com/weaveworks/scope/probe/docker"
|
||||
"github.com/weaveworks/scope/test"
|
||||
)
|
||||
|
||||
type mockConnection struct {
|
||||
@@ -56,11 +59,10 @@ func TestContainer(t *testing.T) {
|
||||
if err = json.NewEncoder(writer).Encode(&stats); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
runtime.Gosched() // wait for StartGatheringStats goroutine to receive the stats
|
||||
|
||||
// Now see if we go them
|
||||
nmd := c.GetNodeMetadata()
|
||||
if nmd[docker.MemoryUsage] != "12345" {
|
||||
t.Errorf("want 12345, got %s", nmd[docker.MemoryUsage])
|
||||
}
|
||||
test.Poll(t, 10*time.Millisecond, func() bool {
|
||||
nmd := c.GetNodeMetadata()
|
||||
return nmd[docker.MemoryUsage] == "12345"
|
||||
}, "Failed to get stats")
|
||||
}
|
||||
|
||||
@@ -160,13 +160,11 @@ func TestRegistry(t *testing.T) {
|
||||
defer registry.Stop()
|
||||
runtime.Gosched()
|
||||
|
||||
{
|
||||
test.Poll(t, 10*time.Millisecond, func() bool {
|
||||
have := allContainers(registry)
|
||||
want := []docker.Container{&mockContainer{container1}}
|
||||
if !reflect.DeepEqual(want, have) {
|
||||
t.Errorf("%s", test.Diff(want, have))
|
||||
}
|
||||
}
|
||||
return reflect.DeepEqual(want, have)
|
||||
}, "Didn't get containers!")
|
||||
|
||||
{
|
||||
have := allImages(registry)
|
||||
|
||||
Reference in New Issue
Block a user