yannizhou05 opened a new pull request, #6905:
URL: https://github.com/apache/cloudstack/pull/6905

   ### Description
   
   The tests below in `NeutronNetworkAdapterTest.java`, 
`NeutronNodeAdapterTest.java` and `NeutronPortAdapterTest.java` were found 
flaky because of the ordering of JSON objects. The orders of elements in the 
JSON objects were not the same every time the test being called. In this case, 
JsonParser from Gson was applied to ensure the orders do not cause the 
flakiness. This code change is trying to fix the [flaky 
tests](https://docs.gitlab.com/ee/development/testing_guide/flaky_tests.html) 
mentioned above, because they sometimes fail (as the picture showed) and 
sometimes pass. The failure could be reproduced by the commands below by using 
the tool of [NonDex](https://github.com/TestingResearchIllinois/NonDex). The 
code change is to make sure the tests will always pass in this case.
   
   - 
`org.apache.cloudstack.network.opendaylight.api.test.NeutronNetworkAdapterTest.gsonNeutronNetworkMarshalingTest`
   - 
`org.apache.cloudstack.network.opendaylight.api.test.NeutronNodeAdapterTest.gsonNeutronPortMarshalingTest`
   - 
`org.apache.cloudstack.network.opendaylight.api.test.NeutronNodeAdapterTest.gsonNeutronPortMarshalingTest`
   
   <!--- Describe your changes in DETAIL - And how has behaviour functionally 
changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
*********************************************************************************
 -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
*********************************************************************************
 -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   <img width="893" alt="1" 
src="https://user-images.githubusercontent.com/61256379/202354808-9587bc19-bdfb-4bc8-9af8-192f09ff665a.png";>
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to 
-->
   <!-- see how your change affects other areas of the code, etc. -->
   
   The test failures could be reproduced by
   
   1. `mvn install -pl plugins/network-elements/opendaylight -am -DskipTests`
   2.  run tests with NonDex 
       `mvn -pl plugins/network-elements/opendaylight 
edu.illinois:nondex-maven-plugin:2.1:nondex 
-Dtest=org.apache.cloudstack.network.opendaylight.api.test.NeutronNodeAdapterTest#gsonNeutronPortMarshalingTest`
   
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to