Re: Review Request 48325: Unit tests failing because of the order of hash sets/maps

2016-06-08 Thread Oliver Szabo

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48325/#review136618
---


Ship it!




Ship It!

- Oliver Szabo


On June 7, 2016, 1:02 p.m., Miklos Gergely wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48325/
> ---
> 
> (Updated June 7, 2016, 1:02 p.m.)
> 
> 
> Review request for Ambari, Daniel Gergely, Oliver Szabo, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-17004
> https://issues.apache.org/jira/browse/AMBARI-17004
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Some unit tests are failing because they depend on the order elements are 
> returned by the iterator of a HashSet/HashMap. Usually they are small (2-3 
> entries), so they may easily produce good results. Still in other 
> environments they fail as the order the elements are returned from a 
> HashSet/HashMap may depend on the JVM used.
> 
> The issues are elaborated in the comments of the bug.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/audit/event/request/ChangeRepositoryVersionRequestAuditEvent.java
>  74e7267 
>   
> ambari-server/src/main/java/org/apache/ambari/server/audit/event/request/ClusterPrivilegeChangeRequestAuditEvent.java
>  cc59038 
>   
> ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/RepositoryVersionEventCreator.java
>  2f09b74 
>   
> ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/RequestAuditEventCreatorHelper.java
>  f7a6e36 
>   
> ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/PrivilegeEventCreatorTest.java
>  ff4abd6 
>   
> ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ViewPrivilegeEventCreatorTest.java
>  ab2b068 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
>  d299fad 
>   
> ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java
>  fbe233d 
> 
> Diff: https://reviews.apache.org/r/48325/diff/
> 
> 
> Testing
> ---
> 
> Tests are running fine now even on my computer which wasn't true before. They 
> failed some times on Jenkins too.
> 
> 
> Thanks,
> 
> Miklos Gergely
> 
>



Re: Review Request 48325: Unit tests failing because of the order of hash sets/maps

2016-06-07 Thread Sebastian Toader

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48325/#review136445
---




ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/RequestAuditEventCreatorHelper.java
 (lines 88 - 89)


Is it a valid scenario that ```getPropertyList``` is invoked with an 
invalid ```propertyName```? If not than that's an error case an we should throw 
an exception.



ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/PrivilegeEventCreatorTest.java
 (lines 99 - 110)


You could extract the common part into a separate string such as to reduce 
the copy-pasting.



ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/RepositoryVersionEventCreatorTest.java
 (lines 62 - 75)


You could extract the common part into a separate string such as to reduce 
the copy-pasting.



ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/RepositoryVersionEventCreatorTest.java
 (lines 100 - 113)


You could extract the common part into a separate string such as to reduce 
the copy-pasting.



ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ViewPrivilegeEventCreatorTest.java
 (lines 77 - 90)


You could extract the common part into a separate string such as to reduce 
the copy-pasting.



ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
 (lines 229 - 231)


Can you comment how this change relates to the hash/sets ordering?


- Sebastian Toader


On June 7, 2016, 11:53 a.m., Miklos Gergely wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48325/
> ---
> 
> (Updated June 7, 2016, 11:53 a.m.)
> 
> 
> Review request for Ambari, Daniel Gergely, Oliver Szabo, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-17004
> https://issues.apache.org/jira/browse/AMBARI-17004
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> Some unit tests are failing because they depend on the order elements are 
> returned by the iterator of a HashSet/HashMap. Usually they are small (2-3 
> entries), so they may easily produce good results. Still in other 
> environments they fail as the order the elements are returned from a 
> HashSet/HashMap may depend on the JVM used.
> 
> The issues are elaborated in the comments of the bug.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/audit/request/eventcreator/RequestAuditEventCreatorHelper.java
>  f7a6e36 
>   
> ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/PrivilegeEventCreatorTest.java
>  ff4abd6 
>   
> ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/RepositoryVersionEventCreatorTest.java
>  18e2d3f 
>   
> ambari-server/src/test/java/org/apache/ambari/server/audit/request/creator/ViewPrivilegeEventCreatorTest.java
>  ab2b068 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
>  d299fad 
>   
> ambari-server/src/test/java/org/apache/ambari/server/security/ldap/AmbariLdapDataPopulatorTest.java
>  fbe233d 
> 
> Diff: https://reviews.apache.org/r/48325/diff/
> 
> 
> Testing
> ---
> 
> Tests are running fine now even on my computer which wasn't true before. They 
> failed some times on Jenkins too.
> 
> 
> Thanks,
> 
> Miklos Gergely
> 
>