YARN-7594. TestNMWebServices#testGetNMResourceInfo fails on trunk. Contributed by Gergely Novák.

This commit is contained in:
Sunil G 2017-12-04 10:45:07 +05:30 committed by Jonathan Hung
parent ca7d0fda4f
commit c539427696

View File

@ -456,17 +456,17 @@ public void testGetNMResourceInfo()
ClientResponse.class);
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
// Access resource-2 should fail (null NMResourceInfo returned).
// Access resource-2 should fail (empty NMResourceInfo returned).
JSONObject json = response.getEntity(JSONObject.class);
assertIncludesException(json);
assertEquals(0, json.length());
// Access resource-3 should fail (unkown plugin)
// Access resource-3 should fail (unknown plugin)
response = r.path("ws").path("v1").path("node").path(
"resources").path("resource-3").accept(MediaType.APPLICATION_JSON).get(
ClientResponse.class);
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
json = response.getEntity(JSONObject.class);
assertIncludesException(json);
assertEquals(0, json.length());
// Access resource-1 should success
response = r.path("ws").path("v1").path("node").path(
@ -533,10 +533,6 @@ public void testGetYarnGpuResourceInfo()
assertEquals(2, json.getJSONArray("assignedGpuDevices").length());
}
private void assertIncludesException(JSONObject json) {
assertTrue(json.has("RemoteException"));
}
private void testContainerLogs(WebResource r, ContainerId containerId)
throws IOException {
final String containerIdStr = containerId.toString();