Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid fetching information unnecessarily when rerun env #3515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lisa/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,18 @@ 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()
# avoid fetching information unnecessarily when rerun env
force_run = True
if (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if block needs more explanation to understand what's the problem is fixed. so it won't be confused in future.

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
Loading