Skip to content

Commit

Permalink
call wait_for_build_to_finish after reading logs finished, as there is
Browse files Browse the repository at this point in the history
race between all pods finished and pipeline run status changed

* CLOUDBLD-8359

Signed-off-by: Robert Cerven <rcerven@redhat.com>
  • Loading branch information
rcerven committed Jan 10, 2022
1 parent e2b9564 commit 418913a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions koji_containerbuild/plugins/builder_containerbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ def sigint_handler(*args, **kwargs):
# so we have to collect them back when the process ends
user_warnings = self._read_user_warnings(osbs_logs_dir)

# there is race between all pods finished and pipeline run changing status
self.osbs().wait_for_build_to_finish(build_id)

has_succeeded = self.osbs().build_has_succeeded(build_id)
annotations = self.osbs().get_build_annotations(build_id)
labels = self.osbs().get_build_labels(build_id)
Expand Down
1 change: 1 addition & 0 deletions tests/test_builder_containerbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ def _mock_osbs(self, koji_build_id, src, koji_task_id, source=False,
(flexmock(osbs.api.OSBS)
.should_receive('get_build_error_message')
.and_return("build error"))
(flexmock(osbs.api.OSBS).should_receive('wait_for_build_to_finish').and_return(None))

def _mock_folders(self, tmpdir, dockerfile_content=None, additional_tags_content=None):
if dockerfile_content is None:
Expand Down

0 comments on commit 418913a

Please sign in to comment.