Merge pull request #3744 from satnam6502/dns

Allow cluster DNS e2e test to be run in parallel
This commit is contained in:
Filipe Brandenburger 2015-01-22 16:15:30 -08:00
commit fc4089c166
2 changed files with 14 additions and 9 deletions

View File

@ -22,6 +22,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog" "github.com/golang/glog"
) )
@ -66,7 +67,7 @@ func TestClusterDNS(c *client.Client) bool {
APIVersion: "v1beta1", APIVersion: "v1beta1",
}, },
ObjectMeta: api.ObjectMeta{ ObjectMeta: api.ObjectMeta{
Name: "dns-test", Name: "dns-test-" + string(util.NewUUID()),
}, },
Spec: api.PodSpec{ Spec: api.PodSpec{
Volumes: []api.Volume{ Volumes: []api.Volume{
@ -104,7 +105,7 @@ func TestClusterDNS(c *client.Client) bool {
} }
_, err := podClient.Create(pod) _, err := podClient.Create(pod)
if err != nil { if err != nil {
glog.Errorf("Failed to create dns-test pod: %v", err) glog.Errorf("Failed to create %s pod: %v", pod.Name, err)
return false return false
} }
defer podClient.Delete(pod.Name) defer podClient.Delete(pod.Name)
@ -112,7 +113,7 @@ func TestClusterDNS(c *client.Client) bool {
waitForPodRunning(c, pod.Name) waitForPodRunning(c, pod.Name)
pod, err = podClient.Get(pod.Name) pod, err = podClient.Get(pod.Name)
if err != nil { if err != nil {
glog.Errorf("Failed to get pod: %v", err) glog.Errorf("Failed to get pod %s: %v", pod.Name, err)
return false return false
} }
@ -130,22 +131,22 @@ func TestClusterDNS(c *client.Client) bool {
Do().Raw() Do().Raw()
if err != nil { if err != nil {
failed = append(failed, name) failed = append(failed, name)
glog.V(4).Infof("Lookup for %s failed: %v", name, err) glog.V(4).Infof("Lookup using %s for %s failed: %v", pod.Name, name, err)
} }
} }
if len(failed) == 0 { if len(failed) == 0 {
break break
} }
glog.Infof("lookups failed for: %v", failed) glog.Infof("lookups using %s failed for: %v", pod.Name, failed)
time.Sleep(3 * time.Second) time.Sleep(10 * time.Second)
} }
if len(failed) != 0 { if len(failed) != 0 {
glog.Errorf("DNS failed for: %v", failed) glog.Errorf("DNS using %s failed for: %v", pod.Name, failed)
return false return false
} }
// TODO: probe from the host, too. // TODO: probe from the host, too.
glog.Info("DNS probes succeeded") glog.Infof("DNS probes using %s succeeded", pod.Name)
return true return true
} }

View File

@ -69,7 +69,11 @@ func RunE2ETests(authConfig, certDir, host, repoRoot, provider string, orderseed
// TODO: Associate a timeout with each test individually. // TODO: Associate a timeout with each test individually.
go func() { go func() {
defer util.FlushLogs() defer util.FlushLogs()
time.Sleep(10 * time.Minute) // TODO: We should modify testSpec to include an estimated running time
// for each test and use that information to estimate a timeout
// value. Until then, as we add more tests (and before we move to
// parallel testing) we need to adjust this value as we add more tests.
time.Sleep(15 * time.Minute)
glog.Fatalf("This test has timed out. Cleanup not guaranteed.") glog.Fatalf("This test has timed out. Cleanup not guaranteed.")
}() }()