Skip to content

Commit

Permalink
Avoid saving the final serial report when parallel experiment is no…
Browse files Browse the repository at this point in the history
…t enabled
  • Loading branch information
Swatinem committed Sep 12, 2024
1 parent 18009c5 commit 1d25d4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tasks/tests/unit/test_upload_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_upload_task_call(
],
report_code=None,
in_parallel=False,
is_final=True,
is_final=False,
)
kwargs = dict(
repoid=commit.repoid,
Expand Down Expand Up @@ -659,7 +659,7 @@ def test_upload_task_call_multiple_processors(
],
report_code=None,
in_parallel=False,
is_final=True,
is_final=False,
)
kwargs = dict(
repoid=commit.repoid,
Expand Down Expand Up @@ -1164,7 +1164,7 @@ def test_schedule_task_with_one_task(self, dbsession, mocker):
arguments_list=argument_list,
report_code=None,
in_parallel=False,
is_final=True,
is_final=False,
)
t2 = upload_finisher_task.signature(
kwargs={
Expand Down
11 changes: 6 additions & 5 deletions tasks/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@ def _schedule_coverage_processing_task(
):
checkpoints.log(UploadFlow.INITIAL_PROCESSING_COMPLETE)

do_parallel_processing = PARALLEL_UPLOAD_PROCESSING_BY_REPO.check_value(
identifier=commit.repository.repoid
) and not delete_archive_setting(commit_yaml)

processing_tasks = [
upload_processor_task.s(
repoid=commit.repoid,
Expand All @@ -609,7 +613,8 @@ def _schedule_coverage_processing_task(
for chunk in itertools.batched(argument_list, CHUNK_SIZE)
]
processing_tasks[0].args = ({},) # this is the first `previous_results`
processing_tasks[-1].kwargs.update(is_final=True)
if do_parallel_processing:
processing_tasks[-1].kwargs.update(is_final=True)

processing_tasks.append(
upload_finisher_task.signature(
Expand All @@ -626,10 +631,6 @@ def _schedule_coverage_processing_task(

serial_tasks = chain(processing_tasks)

do_parallel_processing = PARALLEL_UPLOAD_PROCESSING_BY_REPO.check_value(
identifier=commit.repository.repoid
) and not delete_archive_setting(commit_yaml)

if not do_parallel_processing:
return serial_tasks.apply_async()

Expand Down

0 comments on commit 1d25d4e

Please sign in to comment.