Skip to content

Commit

Permalink
Duplicate tasks created (Significant-Gravitas#5358)
Browse files Browse the repository at this point in the history
Signed-off-by: Merwane Hamadi <[email protected]>
  • Loading branch information
waynehamadi authored Sep 27, 2023
1 parent a14aadd commit e0aa11f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion benchmark/agbenchmark/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
7 changes: 6 additions & 1 deletion benchmark/tests/test_benchmark_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0aa11f

Please sign in to comment.