Skip to content

test: adjust reduced interval check for waitForCondition#56

Merged
eglitise merged 1 commit intoappium:masterfrom
eglitise:adjust-test
Jan 21, 2026
Merged

test: adjust reduced interval check for waitForCondition#56
eglitise merged 1 commit intoappium:masterfrom
eglitise:adjust-test

Conversation

@eglitise
Copy link
Copy Markdown
Contributor

The existing test should not exceed implicit wait timeout does not seem to be very useful: waitMs is set to twice the value of intervalMs, which in some cases may result in the second sleep call not reducing intervalMs at all, meaning the test does not actually validate its functionality at all times.

I have now updated the test in two ways:

  • waitMs is set to a value that is not a multiple of intervalMs, thereby ensuring that the last sleep call will always be invoked with a reduced value of intervalMs
  • instead of spying on sleep and validating its last call, the test now checks that the total elapsed time is always below ceil(waitMs/intervalMs). This makes the spy variable obsolete and allows to remove sinon as a whole.

@eglitise eglitise merged commit 07b47dc into appium:master Jan 21, 2026
6 checks passed
@eglitise eglitise deleted the adjust-test branch January 21, 2026 21:49
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants