You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2020/12/11 00:30:00 UTC

[jira] [Resolved] (HBASE-25370) Fix flaky test TestClassFinder#testClassFinderDefaultsToOwnPackage

     [ https://issues.apache.org/jira/browse/HBASE-25370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Duo Zhang resolved HBASE-25370.
-------------------------------
    Fix Version/s: 2.4.1
                   2.5.0
                   2.3.4
                   2.2.7
                   3.0.0-alpha-1
     Hadoop Flags: Reviewed
       Resolution: Fixed

Pushed to branch-2.2+.

Thanks [~hsiang] for contibuting.

> Fix flaky test TestClassFinder#testClassFinderDefaultsToOwnPackage 
> -------------------------------------------------------------------
>
>                 Key: HBASE-25370
>                 URL: https://issues.apache.org/jira/browse/HBASE-25370
>             Project: HBase
>          Issue Type: Test
>            Reporter: Adam Wang
>            Assignee: Adam Wang
>            Priority: Major
>             Fix For: 3.0.0-alpha-1, 2.2.7, 2.3.4, 2.5.0, 2.4.1
>
>
> The test {{TestClassFinder#testClassFinderDefaultsToOwnPackage}} compares two sets from {{allClassesFinder.findClasses}}. However, the function {{allClassesFinder.findClasses}} does not return the deterministic order result. From code trace, the root cause is at {{ClassFinder.findClassesFromJar}} and {{ClassFinder.findClassesFromFiles}}. They use {{HashSet}} to store {{classes}} and {{listFiles}} to get file array. However, {{HashSet}} and {{listFiles}} do not guarantee that order, and the assertion can fail if the order differs.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)