MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / Timeouts

Function Timeouts

tests/utils/timeouts/timeouts.go:85–105  ·  view source on GitHub ↗

Timeouts returns the map of timeouts, where each event gets the timeout specified in the `TEST_TIMEOUTS` environment variable, or if not specified, takes the default value

()

Source from the content-addressed store, hash-verified

83// in the `TEST_TIMEOUTS` environment variable, or if not specified, takes the default
84// value
85func Timeouts() (map[Timeout]int, error) {
86 if timeoutsEnv, exists := os.LookupEnv(TestTimeoutsEnvVar); exists {
87 var timeouts map[Timeout]int
88 err := json.Unmarshal([]byte(timeoutsEnv), &timeouts)
89 if err != nil {
90 return map[Timeout]int{},
91 fmt.Errorf("TEST_TIMEOUTS env variable is not valid: %v", err)
92 }
93 for k, def := range DefaultTestTimeouts {
94 val, found := timeouts[k]
95 if found {
96 timeouts[k] = val
97 } else {
98 timeouts[k] = def
99 }
100 }
101 return timeouts, nil
102 }
103
104 return DefaultTestTimeouts, nil
105}

Callers 1

suite_test.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected