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

[Bug] Incorrect usage of Awaitility.await() in test case #45591

Open
3 tasks done
shuke987 opened this issue Dec 18, 2024 · 0 comments
Open
3 tasks done

[Bug] Incorrect usage of Awaitility.await() in test case #45591

shuke987 opened this issue Dec 18, 2024 · 0 comments

Comments

@shuke987
Copy link
Collaborator

Search before asking

  • I had searched in the issues and found no similar issues.

Version

after #38836

What's Wrong?

In groovy, await is used with assert and without return. e.g.

def counter = 0;

for (int i = 1; i < 20; i++) {
    Awaitility.await().untilAsserted(() -> {
        ++counter
        println "${i}"
        if (counter > 10) {
            assert true
        } else {
            assert false
        }
    });
}

works fine but

def counter = 0;

for (int i = 1; i < 20; i++) {
    Awaitility.await().untilAsserted(() -> {
        ++counter
        println "${i}"
        if (counter > 10) {
            return true
        } else {
            return false
        }
    });
}

will result await quit whenever return value is true or false

What You Expected?

just as mentioned

How to Reproduce?

just as mentioned

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant