Skip to content

Commit afd033b

Browse files
author
Joshua Reed
committed
Standardize polling and timeout
1 parent e77d13b commit afd033b

6 files changed

+7
-14
lines changed

controllers/cloudstackaffinitygroup_controller_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ limitations under the License.
1717
package controllers_test
1818

1919
import (
20-
"time"
21-
2220
"github.com/golang/mock/gomock"
2321
. "github.com/onsi/ginkgo/v2"
2422
. "github.com/onsi/gomega"
@@ -54,6 +52,6 @@ var _ = Describe("CloudStackAffinityGroupReconciler", func() {
5452
}
5553
}
5654
return false
57-
}, timeout).WithPolling(2 * time.Second).Should(BeTrue())
55+
}, timeout).WithPolling(pollInterval).Should(BeTrue())
5856
})
5957
})

controllers/cloudstackcluster_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var _ = Describe("CloudStackClusterReconciler", func() {
4242
return true
4343
}
4444
return false
45-
}, timeout).Should(BeTrue())
45+
}, timeout).WithPolling(pollInterval).Should(BeTrue())
4646
})
4747
})
4848

controllers/cloudstackfailuredomain_controller_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ limitations under the License.
1717
package controllers_test
1818

1919
import (
20-
"time"
21-
2220
"github.com/golang/mock/gomock"
2321
. "github.com/onsi/ginkgo/v2"
2422
. "github.com/onsi/gomega"
@@ -58,7 +56,7 @@ var _ = Describe("CloudStackFailureDomainReconciler", func() {
5856
return tempfd.Status.Ready
5957
}
6058
return false
61-
}, 30*time.Second).WithPolling(time.Second).Should(BeTrue())
59+
}, timeout).WithPolling(pollInterval).Should(BeTrue())
6260
})
6361
})
6462
})

controllers/cloudstackisolatednetwork_controller_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ limitations under the License.
1717
package controllers_test
1818

1919
import (
20-
"time"
21-
2220
g "github.com/golang/mock/gomock"
2321
. "github.com/onsi/ginkgo/v2"
2422
. "github.com/onsi/gomega"
@@ -46,7 +44,7 @@ var _ = Describe("CloudStackIsolatedNetworkReconciler", func() {
4644
return true
4745
}
4846
return false
49-
}, timeout).WithPolling(2 * time.Second).Should(BeTrue())
47+
}, timeout).WithPolling(pollInterval).Should(BeTrue())
5048
})
5149
})
5250
})

controllers/cloudstackmachine_controller_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ limitations under the License.
1717
package controllers_test
1818

1919
import (
20-
"time"
21-
2220
"github.com/golang/mock/gomock"
2321
. "github.com/onsi/ginkgo/v2"
2422
. "github.com/onsi/gomega"
@@ -74,7 +72,7 @@ var _ = Describe("CloudStackMachineReconciler", func() {
7472
}
7573
}
7674
return false
77-
}, 5).WithPolling(2 * time.Second).Should(BeTrue())
75+
}, timeout).WithPolling(pollInterval).Should(BeTrue())
7876
})
7977
})
8078

controllers/controllers_suite_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ var (
6868
)
6969

7070
const (
71-
timeout = time.Second * 30
71+
timeout = 10 * time.Second
72+
pollInterval = 1 * time.Second
7273
)
7374

7475
func envOr(envKey, defaultValue string) string {

0 commit comments

Comments
 (0)