Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -206,7 +207,9 @@ private void verifyLocalFileDeletion(
logAggregationService.init(this.conf);
logAggregationService.start();

ApplicationId application1 = BuilderUtils.newApplicationId(1234, 1);
Random random = new Random(System.currentTimeMillis());
long clusterTimeStamp = random.nextLong();
ApplicationId application1 = BuilderUtils.newApplicationId(clusterTimeStamp, 1);

// AppLogDir should be created
File app1LogDir =
Expand Down Expand Up @@ -245,15 +248,9 @@ private void verifyLocalFileDeletion(

String containerIdStr = container11.toString();
File containerLogDir = new File(app1LogDir, containerIdStr);
int count = 0;
int maxAttempts = 50;
for (String fileType : new String[]{"stdout", "stderr", "syslog"}) {
File f = new File(containerLogDir, fileType);
count = 0;
while ((f.exists()) && (count < maxAttempts)) {
count++;
Thread.sleep(100);
}
GenericTestUtils.waitFor(() -> !f.exists(), 1000, 1000 * 50);
Assert.assertFalse("File [" + f + "] was not deleted", f.exists());
}
Assert.assertFalse("Directory [" + app1LogDir + "] was not deleted",
Expand Down