Increase timeout for deleting RC in e2e tests.

pull/6/head
Wojciech Tyczynski 2015-05-25 10:20:34 +02:00
parent cf7b0bdc2a
commit ff8c772fe0
2 changed files with 8 additions and 1 deletions

View File

@ -60,6 +60,10 @@ func ReaperFor(kind string, c client.Interface) (Reaper, error) {
return nil, &NoSuchReaperError{kind} return nil, &NoSuchReaperError{kind}
} }
func ReaperForReplicationController(c client.Interface, timeout time.Duration) (Reaper, error) {
return &ReplicationControllerReaper{c, Interval, timeout}, nil
}
type ReplicationControllerReaper struct { type ReplicationControllerReaper struct {
client.Interface client.Interface
pollInterval, timeout time.Duration pollInterval, timeout time.Duration

View File

@ -827,11 +827,14 @@ func waitForRCPodsRunning(c *client.Client, ns, rcName string) error {
// Delete a Replication Controller and all pods it spawned // Delete a Replication Controller and all pods it spawned
func DeleteRC(c *client.Client, ns, name string) error { func DeleteRC(c *client.Client, ns, name string) error {
By(fmt.Sprintf("Deleting replication controller %s in namespace %s", name, ns)) By(fmt.Sprintf("Deleting replication controller %s in namespace %s", name, ns))
reaper, err := kubectl.ReaperFor("ReplicationController", c) reaper, err := kubectl.ReaperForReplicationController(c, 10*time.Minute)
if err != nil { if err != nil {
return err return err
} }
startTime := time.Now()
_, err = reaper.Stop(ns, name, api.NewDeleteOptions(0)) _, err = reaper.Stop(ns, name, api.NewDeleteOptions(0))
deleteRCTime := time.Now().Sub(startTime)
Logf("Deleting RC took: %v", deleteRCTime)
return err return err
} }