(opts *serpent.OptionSet)
| 186 | } |
| 187 | |
| 188 | func (t *timeoutFlags) attach(opts *serpent.OptionSet) { |
| 189 | timeoutLong, timeoutEnv, timeoutDescription := "timeout", "CODER_SCALETEST_TIMEOUT", "Timeout for the entire test run. 0 means unlimited." |
| 190 | jobTimeoutLong, jobTimeoutEnv, jobTimeoutDescription := "job-timeout", "CODER_SCALETEST_JOB_TIMEOUT", "Timeout per job. Jobs may take longer to complete under higher concurrency limits." |
| 191 | if t.cleanup { |
| 192 | timeoutLong, timeoutEnv, timeoutDescription = "cleanup-"+timeoutLong, "CODER_SCALETEST_CLEANUP_TIMEOUT", strings.ReplaceAll(timeoutDescription, "test", "cleanup") |
| 193 | jobTimeoutLong, jobTimeoutEnv, jobTimeoutDescription = "cleanup-"+jobTimeoutLong, "CODER_SCALETEST_CLEANUP_JOB_TIMEOUT", strings.ReplaceAll(jobTimeoutDescription, "jobs", "cleanup jobs") |
| 194 | } |
| 195 | |
| 196 | *opts = append( |
| 197 | *opts, |
| 198 | serpent.Option{ |
| 199 | Flag: timeoutLong, |
| 200 | Env: timeoutEnv, |
| 201 | Description: timeoutDescription, |
| 202 | Default: "30m", |
| 203 | Value: serpent.DurationOf(&t.timeout), |
| 204 | }, |
| 205 | serpent.Option{ |
| 206 | Flag: jobTimeoutLong, |
| 207 | Env: jobTimeoutEnv, |
| 208 | Description: jobTimeoutDescription, |
| 209 | Default: "5m", |
| 210 | Value: serpent.DurationOf(&t.timeoutPerJob), |
| 211 | }, |
| 212 | ) |
| 213 | } |
| 214 | |
| 215 | func (t *timeoutFlags) wrapStrategy(strategy harness.ExecutionStrategy) harness.ExecutionStrategy { |
| 216 | if t.timeoutPerJob > 0 { |
no outgoing calls
no test coverage detected