Rajiv Ramachandran created MAPREDUCE-7461:
---------------------------------------------
Summary: Fixed assertionComparision failure by resolving xml paths
for child elements correctly
Key: MAPREDUCE-7461
URL: https://issues.apache.org/jira/browse/MAPREDUCE-7461
Project: Hadoop Map/Reduce
Issue Type: Bug
Components: test
Affects Versions: 3.3.6
Reporter: Rajiv Ramachandran
Fix For: 3.3.6
The following tests depend on underlying implementation orders which are not
guarenteed, while comparing the contents of the generated XML response.
_org.apache.hadoop.mapreduce.v2.app.webapp.TestAMWebServicesJobs#testJobIdXML_
_org.apache.hadoop.mapreduce.v2.app.webapp.TestAMWebServicesJobs#testJobsXML_
The test attempts to send a HTTP GET request to a specific URL and expects a
response in XML format. However, XML response order is not necessarily
guaranteed. When comparing the the XML contents, The `<name>` tag occurs in
multiple places inside <job> field. However, the root element within <job> is
not always compared due to non-deterministic order. The [getXmlString
utility|https://github.com/kavvya97/hadoop/blob/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/webapp/WebServicesTestUtils.java#L78]
always takes the first <name> tag irrespective of whether it is nested or in
root which causes the test to become flaky.
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 8.377 s
<<< FAILURE! - in
org.apache.hadoop.mapreduce.v2.app.webapp.TestAMWebServicesJobs
[ERROR]
testJobIdXML(org.apache.hadoop.mapreduce.v2.app.webapp.TestAMWebServicesJobs)
Time elapsed: 8.361 s <<< FAILURE!
java.lang.AssertionError:
[name]
Expecting:
"mapreduce.job.acl-view-job"
to match pattern:
"RandomWriter"
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]