Skip to content

Commit

Permalink
fix parallel verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Sep 25, 2024
1 parent f476274 commit 4a06290
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
9 changes: 3 additions & 6 deletions services/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,9 @@ def build_report(
# sess is an encoded dict
if sess.get("st") == "carriedforward":
report_class = EditableReport
with metrics.timer(
f"services.report.ReportService.build_report.{report_class.__name__}"
):
return report_class.from_chunks(
chunks=chunks, files=files, sessions=sessions, totals=totals
)
return report_class.from_chunks(
chunks=chunks, files=files, sessions=sessions, totals=totals
)

def get_archive_service(self, repository: Repository) -> ArchiveService:
return ArchiveService(repository)
Expand Down
4 changes: 3 additions & 1 deletion tasks/tests/integration/test_upload_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ def test_full_upload(

repoid = repository.repoid
commitid = uuid4().hex
commit = CommitFactory.create(repository=repository, commitid=commitid, pullid=12)
commit = CommitFactory.create(
repository=repository, commitid=commitid, pullid=12, _report_json=None
)
dbsession.add(commit)
dbsession.flush()

Expand Down
17 changes: 8 additions & 9 deletions tasks/upload_finisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,17 +561,16 @@ def merge_report(cumulative_report, obj):
),
)

sessionid = next(iter(incremental_report.sessions))
incremental_report.sessions[sessionid].id = sessionid

session_id, session = cumulative_report.add_session(
incremental_report.sessions[parallel_idx], use_id_from_session=True
session = incremental_report.sessions[parallel_idx]
session.id = parallel_idx
_session_id, session = cumulative_report.add_session(
session, use_id_from_session=True
)
session.id = session_id

clear_carryforward_sessions(
cumulative_report, incremental_report, session, UserYaml(commit_yaml)
)
if flags := session.flags:
clear_carryforward_sessions(
cumulative_report, incremental_report, flags, UserYaml(commit_yaml)
)
# ReportService.update_upload_with_processing_result should use this result
# to update the state of Upload. Once the experiment is finished, Upload.state should
# be set to: parallel_processed (instead of processed)
Expand Down

0 comments on commit 4a06290

Please sign in to comment.