YARN-523. Modified a test-case to validate container diagnostics on localization failures. Contributed by Jian He.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1503532 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1fe8e2d7ee
commit
4466d8653f
|
@ -59,6 +59,9 @@ Release 2.1.1-beta - UNRELEASED
|
||||||
YARN-295. Fixed a race condition in ResourceManager RMAppAttempt state
|
YARN-295. Fixed a race condition in ResourceManager RMAppAttempt state
|
||||||
machine. (Mayank Bansal via vinodkv)
|
machine. (Mayank Bansal via vinodkv)
|
||||||
|
|
||||||
|
YARN-523. Modified a test-case to validate container diagnostics on
|
||||||
|
localization failures. (Jian He via vinodkv)
|
||||||
|
|
||||||
Release 2.1.0-beta - 2013-07-02
|
Release 2.1.0-beta - 2013-07-02
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -41,6 +41,8 @@ import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.yarn.api.records.ContainerId;
|
import org.apache.hadoop.yarn.api.records.ContainerId;
|
||||||
|
@ -80,7 +82,7 @@ public class TestContainer {
|
||||||
|
|
||||||
final NodeManagerMetrics metrics = NodeManagerMetrics.create();
|
final NodeManagerMetrics metrics = NodeManagerMetrics.create();
|
||||||
final Configuration conf = new YarnConfiguration();
|
final Configuration conf = new YarnConfiguration();
|
||||||
|
final String FAKE_LOCALIZATION_ERROR = "Fake localization error";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify correct container request events sent to localizer.
|
* Verify correct container request events sent to localizer.
|
||||||
|
@ -294,6 +296,7 @@ public class TestContainer {
|
||||||
wc.localizeResourcesFromInvalidState(failCount);
|
wc.localizeResourcesFromInvalidState(failCount);
|
||||||
assertEquals(ContainerState.LOCALIZATION_FAILED, wc.c.getContainerState());
|
assertEquals(ContainerState.LOCALIZATION_FAILED, wc.c.getContainerState());
|
||||||
verifyCleanupCall(wc);
|
verifyCleanupCall(wc);
|
||||||
|
Assert.assertTrue(wc.getDiagnostics().contains(FAKE_LOCALIZATION_ERROR));
|
||||||
} finally {
|
} finally {
|
||||||
if (wc != null) {
|
if (wc != null) {
|
||||||
wc.finished();
|
wc.finished();
|
||||||
|
@ -663,7 +666,7 @@ public class TestContainer {
|
||||||
throws URISyntaxException {
|
throws URISyntaxException {
|
||||||
LocalResource rsrc = localResources.get(rsrcKey);
|
LocalResource rsrc = localResources.get(rsrcKey);
|
||||||
LocalResourceRequest req = new LocalResourceRequest(rsrc);
|
LocalResourceRequest req = new LocalResourceRequest(rsrc);
|
||||||
Exception e = new Exception("Fake localization error");
|
Exception e = new Exception(FAKE_LOCALIZATION_ERROR);
|
||||||
c.handle(new ContainerResourceFailedEvent(c.getContainerId(), req, e
|
c.handle(new ContainerResourceFailedEvent(c.getContainerId(), req, e
|
||||||
.getMessage()));
|
.getMessage()));
|
||||||
drainDispatcherEvents();
|
drainDispatcherEvents();
|
||||||
|
@ -679,7 +682,7 @@ public class TestContainer {
|
||||||
}
|
}
|
||||||
++counter;
|
++counter;
|
||||||
LocalResourceRequest req = new LocalResourceRequest(rsrc.getValue());
|
LocalResourceRequest req = new LocalResourceRequest(rsrc.getValue());
|
||||||
Exception e = new Exception("Fake localization error");
|
Exception e = new Exception(FAKE_LOCALIZATION_ERROR);
|
||||||
c.handle(new ContainerResourceFailedEvent(c.getContainerId(),
|
c.handle(new ContainerResourceFailedEvent(c.getContainerId(),
|
||||||
req, e.getMessage()));
|
req, e.getMessage()));
|
||||||
}
|
}
|
||||||
|
@ -725,5 +728,9 @@ public class TestContainer {
|
||||||
public int getLocalResourceCount() {
|
public int getLocalResourceCount() {
|
||||||
return localResources.size();
|
return localResources.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDiagnostics() {
|
||||||
|
return c.cloneAndGetContainerStatus().getDiagnostics();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue