[JIRA] (JENKINS-61024) Test fails due to a different iteration order

2020-02-09 Thread contextshuffl...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Context Shuffling created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-61024  
 
 
  Test fails due to a different iteration order   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Components: 
 core  
 
 
Created: 
 2020-02-09 21:12  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Context Shuffling  
 

  
 
 
 
 

 
 Test "hudson.util.ArgumentListBuilderTest#assertKeyValuePairsWithMask" creates an ArgumentListBuilder, add several key value pairs, and mask the second key ("key2"). Following is key part of the implementation of "ArgumentListBuilder.addKeyValuePairs" 

 

...
for (Entry e : props.entrySet()) {
addKeyValuePair(prefix, e.getKey(), e.getValue(), (propsToMask != null) && propsToMask.contains(e.getKey()));
}
...
 

 The loop here iterates using props.entrySet, where props in this test is a HashMap. However, HashMap's entrySet does not have a deterministic iteration order and thus, test fails if the order of iteration is not as expected in the test, which is actually the insertion order.  
 

  
 
 
 
 

 
 
 

 
 

[JIRA] (JENKINS-60357) Test may fail due to a different order of items in XML

2019-12-03 Thread contextshuffl...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Context Shuffling updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-60357  
 
 
  Test may fail due to a different order of items in XML   
 

  
 
 
 
 

 
Change By: 
 Context Shuffling  
 

  
 
 
 
 

 
 Test in [CopyOnWriteListTest | https://github.com/jenkinsci/jenkins/blob/ead55ac41d7a06cca09fcc59cbbf1bfc8c0f81f7/core/src/test/java/hudson/util/CopyOnWriteListTest.java] depends on XStream to serialize and deserilize XML. The test assertions use hard-coded strings. However, the test may fail due to a different order of serialization results.      So tests may fail or pass without any modifications to source code.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.203374.1575398244000.11521.15753983

[JIRA] (JENKINS-60357) Test may fail due to a different order of items in XML

2019-12-03 Thread contextshuffl...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Context Shuffling created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-60357  
 
 
  Test may fail due to a different order of items in XML   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Oliver Gondža  
 
 
Components: 
 jenkins-test-harness  
 
 
Created: 
 2019-12-03 18:37  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Context Shuffling  
 

  
 
 
 
 

 
 Test in CopyOnWriteListTest  depends on XStream to serialize and deserilize XML. The test assertions use hard-coded strings. However, the test may fail due to a different order of serialization results.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This