Skip to content

Commit e29e074

Browse files
committed
Allow the test timeout be configured, instead of hardcoding 10 hours.
1 parent ac85e34 commit e29e074

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cfg.sample.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ try_users = []
8080
# command.
8181
#status_based_exemption = false
8282

83+
# Maximum test duration allowed for testing a PR in this repository.
84+
# Default to 10 hours.
85+
#timeout = 36000
86+
8387
# Branch names. These settings are the defaults; it makes sense to leave these
8488
# as-is.
8589
#[repo.NAME.branch]

homu/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
INTERRUPTED_BY_HOMU_FMT = 'Interrupted by Homu ({})'
3636
INTERRUPTED_BY_HOMU_RE = re.compile(r'Interrupted by Homu \((.+?)\)')
37-
TEST_TIMEOUT = 3600 * 10
37+
DEFAULT_TEST_TIMEOUT = 3600 * 10
3838

3939
global_cfg = {}
4040

@@ -1168,7 +1168,8 @@ def start_build(state, repo_cfgs, buildbot_slots, logger, db, git_cfg):
11681168
branch,
11691169
state.merge_sha))
11701170

1171-
state.start_testing(TEST_TIMEOUT)
1171+
timeout = repo_cfg.get('timeout', DEFAULT_TEST_TIMEOUT)
1172+
state.start_testing(timeout)
11721173

11731174
desc = '{} commit {} with merge {}...'.format(
11741175
'Trying' if state.try_ else 'Testing',
@@ -1244,7 +1245,8 @@ def start_rebuild(state, repo_cfgs):
12441245
state.add_comment(':bomb: Failed to start rebuilding: `{}`'.format(err)) # noqa
12451246
return False
12461247

1247-
state.start_testing(TEST_TIMEOUT)
1248+
timeout = repo_cfg.get('timeout', DEFAULT_TEST_TIMEOUT)
1249+
state.start_testing(timeout)
12481250

12491251
msg_1 = 'Previous build results'
12501252
msg_2 = ' for {}'.format(', '.join('[{}]({})'.format(builder, url) for builder, url in succ_builders)) # noqa

0 commit comments

Comments
 (0)