Skip to content

Commit

Permalink
set timeout to 1 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamasato committed Mar 12, 2023
1 parent c0b1048 commit 765d9f7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package e2e

import (
"context"
"fmt"
"time"

"database/sql"
Expand Down Expand Up @@ -140,7 +139,7 @@ var _ = Describe("E2e", func() {
Consistently(func() bool {
err := k8sClient.Get(ctx, client.ObjectKey{Namespace: mysqlNamespace, Name: secretName}, secret)
return errors.IsNotFound(err)
}, 100 * time.Millisecond).Should(BeTrue())
}, time.Second, time.Second).Should(BeTrue())

By("Create MySQL Deployment and Service")
// create mysql deployment & service
Expand All @@ -150,10 +149,10 @@ var _ = Describe("E2e", func() {
Eventually(func() error {
mysqlUser, err := getMySQLUser(mysqlUserName, mysqlNamespace)
if err != nil {
fmt.Println("failed to get mysqluer")
log.Info("failed to get mysqluer")
return err
}
fmt.Printf("mysqluser: Status: %v, ResourceVersion: %s\n", mysqlUser.Status, mysqlUser.ObjectMeta.ResourceVersion)
log.Info("Successfully got mysqluser", "status", mysqlUser.Status, "ResourceVersion", mysqlUser.ObjectMeta.ResourceVersion)
return k8sClient.Get(ctx, client.ObjectKey{Namespace: mysqlNamespace, Name: secretName}, secret)
}, timeout, interval).Should(Succeed())

Expand All @@ -178,7 +177,7 @@ func checkMySQLHasUser(mysqluser string) (int, error) {
if err := row.Scan(&count); err != nil {
return 0, err
} else {
fmt.Printf("mysql.user count: %s, %d\n", mysqluser, count)
log.Info("mysql.user count: %s, %d\n", mysqluser, count)
return count, nil
}
}
Expand Down

0 comments on commit 765d9f7

Please sign in to comment.