You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Rajiv Ramachandran (Jira)" <ji...@apache.org> on 2023/11/04 00:08:00 UTC

[jira] [Updated] (MAPREDUCE-7461) Fixed assertionComparision failure by resolving xml paths for child elements correctly

     [ https://issues.apache.org/jira/browse/MAPREDUCE-7461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajiv Ramachandran updated MAPREDUCE-7461:
------------------------------------------
    Description: 
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_

_org.apache.hadoop.mapreduce.v2.hs.webapp.TestHsWebServicesJobs#testJobIdXML_

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"

  was:
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"



> 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
>            Priority: Minor
>             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_
> _org.apache.hadoop.mapreduce.v2.hs.webapp.TestHsWebServicesJobs#testJobIdXML_
> 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: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org