Restore two minute timeout
@@ -38,7 +38,7 @@ import (
var (
retryInterval = time.Second * 5
- timeout = time.Minute * 5
+ timeout = time.Duration(getIntEnv("TEST_TIMEOUT", 2)) * time.Minute
storageNamespace = os.Getenv("STORAGE_NAMESPACE")
kafkaNamespace = os.Getenv("KAFKA_NAMESPACE")
debugMode = getBoolEnv("DEBUG_MODE", false)
@@ -64,6 +64,17 @@ func getBoolEnv(key string, defaultValue bool) bool {
return defaultValue
}
+func getIntEnv(key string, defaultValue int) int {
+ if value, ok := os.LookupEnv(key); ok {
+ intValue, err := strconv.Atoi(value)
+ if err != nil {
+ logrus.Warnf("Error [%v] received converting environment variable [%s] using [%v]", err, key, value)
+ }
+ return intValue
+ }
+ return defaultValue
+}
+
// GetPod returns pod name
func GetPod(namespace, namePrefix, containsImage string, kubeclient kubernetes.Interface) corev1.Pod {
pods, err := kubeclient.CoreV1().Pods(namespace).List(metav1.ListOptions{})
