From 880a39294e90b41858ab1e512e2cb82316aba25b Mon Sep 17 00:00:00 2001 From: Jesse Schwartzentruber Date: Tue, 19 Nov 2024 16:17:31 -0500 Subject: [PATCH] [fuzzing-decision] Limit deadline to 5 days (TC API limit) --- .../src/fuzzing_decision/decision/pool.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/services/fuzzing-decision/src/fuzzing_decision/decision/pool.py b/services/fuzzing-decision/src/fuzzing_decision/decision/pool.py index 4b3da391..cd9a8255 100644 --- a/services/fuzzing-decision/src/fuzzing_decision/decision/pool.py +++ b/services/fuzzing-decision/src/fuzzing_decision/decision/pool.py @@ -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, @@ -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, @@ -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,