Skip to content

Commit

Permalink
Merge branch 'feature/MaxiBoether/emptyevals' into feature/MaxiBoethe…
Browse files Browse the repository at this point in the history
…r/sigmod-revision-2
  • Loading branch information
MaxiBoether committed Sep 24, 2024
2 parents 48cc329 + 9f5178f commit c9cefce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions modyn/evaluator/internal/grpc/evaluator_grpc_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,12 @@ def cleanup_evaluations(
self._evaluation_process_dict.pop(evaluation_id)

for e_id in evaluation_ids:
self._evaluation_dict.pop(e_id)
self._evaluation_data_dict.pop(e_id)
self._evaluation_data_dict_locks.pop(e_id)
if e_id in self._evaluation_dict:
self._evaluation_dict.pop(e_id)
if e_id in self._evaluation_data_dict:
self._evaluation_data_dict.pop(e_id)
if e_id in self._evaluation_data_dict_locks:
self._evaluation_data_dict_locks.pop(e_id)

gc.collect()
return EvaluationCleanupResponse(succeeded=list(sorted(already_cleaned + not_yet_cleaned)))
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def test__run_evaluation_retain_metrics_before_real_exception(test_connect_to_st

get_result_req = EvaluationResultRequest(evaluation_id=evaluation_id)
get_result_resp = evaluator.get_evaluation_result(get_result_req, None)
assert get_result_resp.valid
assert not get_result_resp.valid
# evaluation on the last interval was not finished
assert len(get_result_resp.evaluation_results) == len(intervals) - 1
assert get_result_resp.evaluation_results[0].interval_index == 0
Expand Down Expand Up @@ -535,7 +535,7 @@ def test_get_evaluation_result_incomplete_metric(test_is_alive, test_connect_to_
metric_result_queue = evaluation_process_info.metric_result_queue
metric_result_queue.put((1, [("Accuracy", 0.5)]))
response = evaluator.get_evaluation_result(EvaluationResultRequest(evaluation_id=3), None)
assert response.valid
assert not response.valid
assert len(response.evaluation_results) == 1
assert response.evaluation_results[0].interval_index == 1
assert len(response.evaluation_results[0].evaluation_data) == 1
Expand Down

0 comments on commit c9cefce

Please sign in to comment.