Skip to content

Commit b868e53

Browse files
committed
fix: use minutes for timeouts
We're logging the contents of those constants and suffixing it with “minutes”, yet... the constant »actually« holds seconds (given the usage of ‹timedelta›). Therefore drop the multiples of ‹60› and use ‹minutes› in the ‹timedelta› construction. Related to packit#15 Signed-off-by: Matej Focko <[email protected]>
1 parent e5ceefe commit b868e53

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/validation/testcase/base.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121

2222
class Testcase(ABC):
23-
CHECK_TIME_FOR_REACTION = 60 * 5
24-
CHECK_TIME_FOR_SUBMIT_BUILDS = 60 * 45
25-
CHECK_TIME_FOR_BUILD = 60 * 20
26-
CHECK_TIME_FOR_WATCH_STATUSES = 60 * 30
23+
CHECK_TIME_FOR_REACTION = 5
24+
CHECK_TIME_FOR_SUBMIT_BUILDS = 45
25+
CHECK_TIME_FOR_BUILD = 20
26+
CHECK_TIME_FOR_WATCH_STATUSES = 30
2727

2828
def __init__(
2929
self,
@@ -136,7 +136,7 @@ async def check_pending_check_runs(self):
136136
"""
137137
status_names = [self.get_status_name(status) for status in self.get_statuses()]
138138

139-
watch_end = datetime.now(tz=timezone.utc) + timedelta(seconds=self.CHECK_TIME_FOR_REACTION)
139+
watch_end = datetime.now(tz=timezone.utc) + timedelta(minutes=self.CHECK_TIME_FOR_REACTION)
140140
failure_message = (
141141
"Github check runs were not set to queued in time "
142142
"({self.CHECK_TIME_FOR_REACTION} minutes).\n"
@@ -195,7 +195,7 @@ async def check_build_submitted(self):
195195
self.trigger_build()
196196

197197
watch_end = datetime.now(tz=timezone.utc) + timedelta(
198-
seconds=self.CHECK_TIME_FOR_SUBMIT_BUILDS,
198+
minutes=self.CHECK_TIME_FOR_SUBMIT_BUILDS,
199199
)
200200

201201
await self.check_pending_check_runs()
@@ -249,7 +249,7 @@ async def check_build(self, build_id):
249249
Args:
250250
build_id: ID of the Copr build
251251
"""
252-
watch_end = datetime.now(tz=timezone.utc) + timedelta(seconds=self.CHECK_TIME_FOR_BUILD)
252+
watch_end = datetime.now(tz=timezone.utc) + timedelta(minutes=self.CHECK_TIME_FOR_BUILD)
253253
state_reported = ""
254254
logging.info("Watching Copr build %s", build_id)
255255

@@ -337,7 +337,7 @@ async def watch_statuses(self):
337337
return.
338338
"""
339339
watch_end = datetime.now(tz=timezone.utc) + timedelta(
340-
seconds=self.CHECK_TIME_FOR_WATCH_STATUSES,
340+
minutes=self.CHECK_TIME_FOR_WATCH_STATUSES,
341341
)
342342
logging.info(
343343
"Watching statuses for commit %s",

0 commit comments

Comments
 (0)