From e0aa11f4d709f305d045ffc867ace811110134d4 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Wed, 27 Sep 2023 07:41:51 -0700 Subject: [PATCH] Duplicate tasks created (#5358) Signed-off-by: Merwane Hamadi --- benchmark/agbenchmark/app.py | 1 - benchmark/tests/test_benchmark_workflow.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmark/agbenchmark/app.py b/benchmark/agbenchmark/app.py index bd9b8273..dccad64e 100644 --- a/benchmark/agbenchmark/app.py +++ b/benchmark/agbenchmark/app.py @@ -289,7 +289,6 @@ async def create_agent_task(task_eval_request: TaskEvalRequestBody) -> Task: task_informations[task_response.task_id][ "eval_id" ] = task_eval_request.eval_id - await api_instance.create_agent_task(task_request_body=task_request_body) await upload_artifacts( api_instance, str(Path(CHALLENGES[task_eval_request.eval_id]["path"]).parent), diff --git a/benchmark/tests/test_benchmark_workflow.py b/benchmark/tests/test_benchmark_workflow.py index 25f36496..92fbdbbd 100644 --- a/benchmark/tests/test_benchmark_workflow.py +++ b/benchmark/tests/test_benchmark_workflow.py @@ -31,11 +31,16 @@ def test_entire_workflow( eval_id, input_text, expected_artifact_length, test_name, should_be_successful ): task_request = {"eval_id": eval_id, "input": input_text} - + response = requests.get(f"{URL_AGENT}/agent/tasks") + task_count_before = response.json()["pagination"]["total_items"] # First POST request task_response_benchmark = requests.post( URL_BENCHMARK + "/agent/tasks", json=task_request ) + response = requests.get(f"{URL_AGENT}/agent/tasks") + task_count_after = response.json()["pagination"]["total_items"] + assert task_count_after == task_count_before + 1 + timestamp_after_task_eval_created = datetime.datetime.now(datetime.timezone.utc) time.sleep(1.1) # To make sure the 2 timestamps to compare are different assert task_response_benchmark.status_code == 200