Skip to content

Commit

Permalink
avoid fetching information unnecessarily when rerun env
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Nov 15, 2024
1 parent 2962dc5 commit 13c0226
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lisa/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,21 @@ def _send_result_message(self, stacktrace: Optional[str] = None) -> None:
# force refresh information, when test result status is changed. The
# refreshed information is not used so far. But in case it's needed
# in future, keep it up to date.
self._environment_information = self.environment.get_information()
# force refresh information, when test result status is changed. The
# refreshed information is not used so far. But in case it's needed
# in future, keep it up to date.
# avoid fetching information unnecessarily when rerun env
force_run = True
if (
result_message.status
in [TestResult.status.RUNNING, TestResult.status.SKIPPED]
and not self.environment.is_new
):
force_run = False

self._environment_information = self.environment.get_information(
force_run=force_run
)
self.information.update(self._environment_information)

self.information["environment"] = self.environment.name
Expand Down

0 comments on commit 13c0226

Please sign in to comment.