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

Optimize XCUITest wait methods #16453

Open
jjSDET opened this issue Sep 18, 2023 · 1 comment
Open

Optimize XCUITest wait methods #16453

jjSDET opened this issue Sep 18, 2023 · 1 comment
Assignees
Labels
stale Stalebot use this label to stale issues and PRs

Comments

@jjSDET
Copy link
Contributor

jjSDET commented Sep 18, 2023

The current implementation of the XCUITest waitFor, waitForExistence, and waitForValueToContain which use the NSPredicate/Expectation strategy are long-running and expensive, taking on average about 1.5s up to 3s to run.

We need to optimize our wait strategy to save time on each wait, of which there are nearly 1000, allowing us to see a test execution performance of 1000 seconds or more.

I'm proposing a simple while-loop, which takes on average about 0.059s to assert an element exists.

The trade-off and risk with this is any strategies that wait or an element container, but then act on an element within the container will result in a race condition, causing some element assertions to fail.

Ultimately, we need to address the use of this strategy to avoid test flakiness in the future, but may, in the short term, see some additional 'flakiness', which is really an opportunity to implement a more stable element wait/assert strategy anyway.

┆Issue is synchronized with this Jira Task

@jjSDET jjSDET self-assigned this Sep 18, 2023
Copy link
Contributor

This issue has been automatically marked as stale. Has the issue been fixed, or does it still require the community's attention? Please leave any comment to keep this issue opened. It will be closed automatically if no further update occurs in the next 30 days. Thank you for your contributions!

@github-actions github-actions bot added the stale Stalebot use this label to stale issues and PRs label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stalebot use this label to stale issues and PRs
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant