Skip to content

Commit

Permalink
Fix a race condition where ESR sometimes failed to start ETR (#34)
Browse files Browse the repository at this point in the history
Move check for activity finished before getting environments so
that we always check for environments even if the activity is
is finished. This fixes a race condition where the activity
would finish before we've requested all environments from the
event repository.
  • Loading branch information
t-persson authored Dec 27, 2022
1 parent 9860fd0 commit 4482134
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/etos_suite_runner/lib/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ def sub_suite_environments(self):
)
if activity_triggered is None:
continue
activity_finished = self.__environment_activity_finished(
activity_triggered["meta"]["id"]
)
for environment in request_environment_defined(
self.etos, activity_triggered["meta"]["id"]
):
if environment["meta"]["id"] not in environments:
environments.append(environment["meta"]["id"])
yield environment
activity_finished = self.__environment_activity_finished(
activity_triggered["meta"]["id"]
)
if activity_finished is not None:
if activity_finished["data"]["activityOutcome"]["conclusion"] != "SUCCESSFUL":
raise EnvironmentProviderException(
Expand Down

0 comments on commit 4482134

Please sign in to comment.