YARN-6297. TestAppLogAggregatorImp.verifyFilesUploaded() should check # of filed uploaded with that of files expected (haibochen via rkanter)

This commit is contained in:
Robert Kanter 2017-03-08 10:45:33 -08:00
parent 98142d2f72
commit 287ba4ffa6

View File

@ -146,7 +146,7 @@ public void testAggregatorWhenNoFileOlderThanRetentionPolicyShouldUploadAll()
verifyLogAggregationWithExpectedFiles2DeleteAndUpload(applicationId,
containerId, logRententionSec, recoveredLogInitedTimeMillis,
logFiles, new HashSet<File>());
logFiles, logFiles);
}
@Test
@ -170,7 +170,7 @@ public void testAggregatorWhenAllFilesOlderThanRetentionShouldUploadNone()
final long week = 7 * 24 * 60 * 60;
final long recoveredLogInitedTimeMillis = System.currentTimeMillis() -
2*week;
2 * week * 1000;
verifyLogAggregationWithExpectedFiles2DeleteAndUpload(
applicationId, containerId, week, recoveredLogInitedTimeMillis,
logFiles, new HashSet<File>());
@ -257,7 +257,7 @@ private static void verifyFilesUploaded(Set<String> filesUploaded,
Set<String> filesExpected) {
final String errMsgPrefix = "The set of files uploaded are not the same " +
"as expected";
if(filesUploaded.size() != filesUploaded.size()) {
if(filesUploaded.size() != filesExpected.size()) {
fail(errMsgPrefix + ": actual size: " + filesUploaded.size() + " vs " +
"expected size: " + filesExpected.size());
}
@ -413,7 +413,7 @@ public AppLogAggregatorInTest(Dispatcher dispatcher,
FileContext lfs, long recoveredLogInitedTime) throws IOException {
super(dispatcher, deletionService, conf, appId, ugi, nodeId,
dirsHandler, remoteNodeLogFileForApp, appAcls,
logAggregationContext, context, lfs, recoveredLogInitedTime);
logAggregationContext, context, lfs, -1, recoveredLogInitedTime);
this.applicationId = appId;
this.deletionService = deletionService;