Merge pull request #39794 from kargakis/updated-unit-tests

Automatic merge from submit-queue

Updated unit tests

@janetkuo updated the flaky unit test to have the same structure with regard to uncasting as the rest of the tests. ptal
This commit is contained in:
Kubernetes Submit Queue
2017-01-13 18:39:55 -08:00
committed by GitHub
5 changed files with 428 additions and 24 deletions

View File

@@ -984,7 +984,7 @@ func DeploymentDeepCopy(deployment *extensions.Deployment) (*extensions.Deployme
}
// SelectorUpdatedBefore returns true if the former deployment's selector
// is updated before the latter, false otherwise
// is updated before the latter, false otherwise.
func SelectorUpdatedBefore(d1, d2 *extensions.Deployment) bool {
t1, t2 := LastSelectorUpdate(d1), LastSelectorUpdate(d2)
return t1.Before(t2)
@@ -994,7 +994,7 @@ func SelectorUpdatedBefore(d1, d2 *extensions.Deployment) bool {
func LastSelectorUpdate(d *extensions.Deployment) metav1.Time {
t := d.Annotations[SelectorUpdateAnnotation]
if len(t) > 0 {
parsedTime, err := time.Parse(t, time.RFC3339)
parsedTime, err := time.Parse(time.RFC3339, t)
// If failed to parse the time, use creation timestamp instead
if err != nil {
return d.CreationTimestamp