[
https://issues.apache.org/jira/browse/LANG-1612?focusedWorklogId=508897&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-508897
]
ASF GitHub Bot logged work on LANG-1612:
----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Nov/20 15:40
Start Date: 08/Nov/20 15:40
Worklog Time Spent: 10m
Work Description: tongxin97 opened a new pull request #640:
URL: https://github.com/apache/commons-lang/pull/640
Issue link: https://issues.apache.org/jira/browse/LANG-1612
Don't use `assertArrayEquals()` because it would fail when the array
returned by `FieldUtils.getAllFields(...)` is not ordered in the way the test
assumes in `annotatedFields` and `ArrayUtils.addAll(fieldsInteger,
fieldsNumber)`.
Instead, do order-independent assertions on: 1) the size of the returned
array, 2) the element it contains.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 508897)
Remaining Estimate: 0h
Time Spent: 10m
> testGetAllFields and testGetFieldsWithAnnotation are flaky
> ----------------------------------------------------------
>
> Key: LANG-1612
> URL: https://issues.apache.org/jira/browse/LANG-1612
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.reflect.*
> Affects Versions: 3.11
> Reporter: XinT
> Priority: Minor
> Labels: pull-request-available, test
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The testGetAllFields() and testGetFieldsWithAnnotation() functions in
> FieldUtilsTest are flaky because they contain assertArraysEquals() on two
> arrays that may not be exactly equal. The arrays are guaranteed to contain
> the exact same elements, but the elements may be ordered differently, causing
> the assertion to sometimes fail.
> More specifically, FieldUtils.getAllFields() does not necessarily return an
> array in the order that the current tests assume.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)