Skip to content

Commit

Permalink
[fuzzing-decision] Limit deadline to 5 days (TC API limit)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwartzentruber committed Nov 19, 2024
1 parent ef31ee4 commit 5891a4e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions services/fuzzing-decision/src/fuzzing_decision/decision/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ def build_tasks(
task = yaml.safe_load(
FUZZING_TASK.substitute(
created=stringDate(now),
deadline=stringDate(now + timedelta(seconds=preprocess.cycle_time)),
deadline=stringDate(
now
+ min(
timedelta(days=5), timedelta(seconds=preprocess.cycle_time)
)
),
description=DESCRIPTION.replace("\n", "\\n"),
expires=stringDate(fromNow("4 weeks", now)),
max_run_time=preprocess.max_run_time,
Expand All @@ -462,7 +467,9 @@ def build_tasks(
task = yaml.safe_load(
FUZZING_TASK.substitute(
created=stringDate(now),
deadline=stringDate(now + timedelta(seconds=self.cycle_time)),
deadline=stringDate(
now + min(timedelta(days=5), timedelta(seconds=self.cycle_time))
),
description=DESCRIPTION.replace("\n", "\\n"),
expires=stringDate(fromNow("4 weeks", now)),
max_run_time=self.max_run_time,
Expand Down Expand Up @@ -616,7 +623,10 @@ def build_tasks(
task = yaml.safe_load(
FUZZING_TASK.substitute(
created=stringDate(now),
deadline=stringDate(now + timedelta(seconds=pool.cycle_time)),
deadline=stringDate(
now
+ min(timedelta(days=5), timedelta(seconds=pool.cycle_time))
),
description=DESCRIPTION.replace("\n", "\\n"),
expires=stringDate(fromNow("4 weeks", now)),
max_run_time=pool.max_run_time,
Expand Down

0 comments on commit 5891a4e

Please sign in to comment.