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

Fixed flaky tests due to class.getMethods #1525

Merged
merged 3 commits into from
Oct 26, 2021
Merged

Fixed flaky tests due to class.getMethods #1525

merged 3 commits into from
Oct 26, 2021

Conversation

Augustine-C
Copy link
Contributor

I found some flaky tests in feign.TypesResolveReturnTypeTest that are caused by using the class.getMethods method.

According to Java docs:

The elements in the returned array are not sorted and are not in any particular order.

This means that future changes in Java may change the order of the returned list, and cause tests failures in this file. I created a getMethods method to sort the result from class.getMethods using alphabetical order with combos of the method name and return type name.

Then I just replaced the class.getMethods with the new getMethods method, and updated some of the indexs in related tests to ensure deterministic order and behavior in the future.

@velo velo merged commit 3e274d0 into OpenFeign:master Oct 26, 2021
@Augustine-C Augustine-C deleted the flaky-tests branch October 26, 2021 21:57
velo pushed a commit that referenced this pull request Oct 7, 2024
* Fixed flaky tests due to `class.getMethod`

* Simplify Comparator code
velo pushed a commit that referenced this pull request Oct 8, 2024
* Fixed flaky tests due to `class.getMethod`

* Simplify Comparator code
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

Successfully merging this pull request may close these issues.

2 participants