You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Hussain-Safwan (via GitHub)" <gi...@apache.org> on 2025/09/10 03:15:40 UTC

[PR] Fixed flaky test: org.apache.dubbo.common.bytecode.WrapperTest.est_getMethodNames_ContainExtendsParentMethods [dubbo]

Hussain-Safwan opened a new pull request, #15683:
URL: https://github.com/apache/dubbo/pull/15683

   ### What is the purpose of this PR
   
   - The purpose of this PR is to resolve the unpredictability caused by the **flaky test**: `org.apache.dubbo.common.bytecode.WrapperTest.est_getMethodNames_ContainExtendsParentMethods`.
   - The test passes/fails based on the ordering of the names of methods returned by`getMethodNames` methods from `Wrapper` and `ClassUtils` classes.
   
   ### Why the test fail
   
   - The test asserts whether a certain array containing the names of the methods is available in the aforementioned classes.
   - The problem, however, arises because the order in which the names would be returned is not guaranteed by the method used to retrieve the names.
   - But `assertArrayEquals` expects even the order of the array elements to match - hence sometimes causing the failure. 
   
   ### How to reproduce the test failure
   
   - The scenario may be reproduced by running the tests with **Nondex** tool:
   
   -     `mvn -pl dubbo-common edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=org.apache.dubbo.common.bytecode.WrapperTest#test_getMethodNames_ContainExtendsParentMethods`
   
   - Instructions on Nondex installation may be found [here](https://github.com/TestingResearchIllinois/NonDex).
   
   ### Expected results
   
   The test should run successfully with Nondex instrumentation.
   
   ### Actual Results
   
   - Following error result is obtained upon running the original code with Nondex: 
   - `[ERROR] Failed to execute goal edu.illinois:nondex-maven-plugin:2.1.7:nondex (default-cli) on project dubbo-common: Unable to execute mojo: There are test failures.`
   - Evidence that the test is indeed failing due to the difference in ordering can be observed in the following line: 
   - `[ERROR]   WrapperTest.test_getMethodNames_ContainExtendsParentMethods:184 array contents differ at index [0], expected: <hello> but was: <world>`
   
   ### Description of fix
   
   - The idea is to sort the array containing the names of methods before asserting.
   - This can be performed using the `sort` method of `java.util` as in `Arrays.sort(methodNames)`.
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fixed flaky test: org.apache.dubbo.common.bytecode.WrapperTest.est_getMethodNames_ContainExtendsParentMethods [dubbo]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15683:
URL: https://github.com/apache/dubbo/pull/15683#issuecomment-3273224519

   ## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/15683?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 58.99%. Comparing base ([`5b9adb0`](https://app.codecov.io/gh/apache/dubbo/commit/5b9adb04df62b0ae800025187319b180a18cebab?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6b6b3f8`](https://app.codecov.io/gh/apache/dubbo/commit/6b6b3f8d4740c6245c6c7d77f794cdbab0de284d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 3 commits behind head on 3.3.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.3   #15683      +/-   ##
   ============================================
   - Coverage     61.06%   58.99%   -2.07%     
   ============================================
     Files          1923     1890      -33     
     Lines         87069    86261     -808     
     Branches      13112    12941     -171     
   ============================================
   - Hits          53165    50893    -2272     
   - Misses        28465    29791    +1326     
   - Partials       5439     5577     +138     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15683/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.99% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/15683?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fixed flaky test: org.apache.dubbo.common.bytecode.WrapperTest.est_getMethodNames_ContainExtendsParentMethods [dubbo]

Posted by "zrlw (via GitHub)" <gi...@apache.org>.
zrlw merged PR #15683:
URL: https://github.com/apache/dubbo/pull/15683


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org