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

Add retry when StaleElementReferenceException is raised for Submariner installation #10168

Closed
wants to merge 12 commits into from

Conversation

am-agrawa
Copy link
Contributor

fixes #9622

@am-agrawa am-agrawa self-assigned this Jul 24, 2024
@am-agrawa am-agrawa requested a review from a team as a code owner July 24, 2024 11:26
@pull-request-size pull-request-size bot added the size/S PR that changes 10-29 lines label Jul 24, 2024
log.info("Click on 'Install Submariner add-ons' button")
except StaleElementReferenceException:
if attempt == retries - 1:
raise
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to make a screenshot in case of this exception and/or log the locator of the stale element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

ebondare
ebondare previously approved these changes Jul 25, 2024
@openshift-ci openshift-ci bot added the lgtm label Jul 25, 2024
@pull-request-size pull-request-size bot removed the size/S PR that changes 10-29 lines label Jul 26, 2024
@openshift-ci openshift-ci bot removed the lgtm label Jul 26, 2024
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines label Jul 26, 2024
Copy link

openshift-ci bot commented Jul 26, 2024

New changes are detected. LGTM label has been removed.

Copy link

openshift-ci bot commented Jul 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: am-agrawa

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
Copy link

openshift-ci bot commented Jul 26, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: am-agrawa

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: am-agrawa <[email protected]>
Signed-off-by: am-agrawa <[email protected]>
Signed-off-by: am-agrawa <[email protected]>
@pull-request-size pull-request-size bot added size/S PR that changes 10-29 lines and removed size/M PR that changes 30-99 lines labels Jul 29, 2024
Signed-off-by: am-agrawa <[email protected]>
Signed-off-by: am-agrawa <[email protected]>
@am-agrawa am-agrawa requested a review from a team as a code owner July 30, 2024 08:13
@pull-request-size pull-request-size bot added size/M PR that changes 30-99 lines and removed size/S PR that changes 10-29 lines labels Jul 30, 2024
Signed-off-by: am-agrawa <[email protected]>
Signed-off-by: am-agrawa <[email protected]>
Signed-off-by: am-agrawa <[email protected]>
Signed-off-by: am-agrawa <[email protected]>
@pull-request-size pull-request-size bot added size/S PR that changes 10-29 lines and removed size/M PR that changes 30-99 lines labels Jul 30, 2024
retries = 6
for attempt in range(retries):
try:
WebDriverWait(self, 10).until(
Copy link
Contributor

Choose a reason for hiding this comment

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

here you need to pass self.driver, but not self to constructor of WebDriverWait

Signed-off-by: am-agrawa <[email protected]>
@@ -234,7 +240,9 @@ def install_submariner_ui(self, globalnet=True):
log.info("Click on 'Submariner add-ons' tab")
self.do_click(self.page_nav["submariner-tab"])
log.info("Click on 'Install Submariner add-ons' button")
self.do_click(self.page_nav["install-submariner-btn"], timeout=120)
retry((StaleElementReferenceException, TimeoutException), retries=5, delay=10)(
Copy link
Contributor

Choose a reason for hiding this comment

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

if you haven't tested it yet, pls consider the first option we discussed, it refreshes the page in between retries.

 self.do_click(
            self.page_nav["install-submariner-btn"], enable_screenshot=True, avoid_stale=True
        )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in #9646

@am-agrawa
Copy link
Contributor Author

Fixed as part of pr##9646

@am-agrawa am-agrawa closed this Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S PR that changes 10-29 lines Squad/Turquoise
Projects
None yet
3 participants