-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-11305. Fix TestLogAggregationService#testLocalFileDeletionAfterUpload Failed After YARN-11241(#4703). #4893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,11 +202,11 @@ public void tearDown() throws IOException, InterruptedException { | |
| } | ||
|
|
||
| private void verifyLocalFileDeletion( | ||
| LogAggregationService logAggregationService) throws Exception { | ||
| LogAggregationService logAggregationService, Long clusterTimeStamp) throws Exception { | ||
| logAggregationService.init(this.conf); | ||
| logAggregationService.start(); | ||
|
|
||
| ApplicationId application1 = BuilderUtils.newApplicationId(1234, 1); | ||
| ApplicationId application1 = BuilderUtils.newApplicationId(clusterTimeStamp, 1); | ||
|
|
||
| // AppLogDir should be created | ||
| File app1LogDir = | ||
|
|
@@ -252,7 +252,7 @@ private void verifyLocalFileDeletion( | |
| count = 0; | ||
| while ((f.exists()) && (count < maxAttempts)) { | ||
| count++; | ||
| Thread.sleep(100); | ||
| Thread.sleep(1000); | ||
| } | ||
| Assert.assertFalse("File [" + f + "] was not deleted", f.exists()); | ||
| } | ||
|
|
@@ -310,7 +310,7 @@ public void testLocalFileDeletionAfterUpload() throws Exception { | |
| LogAggregationService logAggregationService = spy( | ||
| new LogAggregationService(dispatcher, this.context, this.delSrvc, | ||
| super.dirsHandler)); | ||
| verifyLocalFileDeletion(logAggregationService); | ||
| verifyLocalFileDeletion(logAggregationService, 1234L); | ||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -324,7 +324,7 @@ public void testLocalFileRemainsAfterUploadOnCleanupDisable() throws Exception { | |
| this.remoteRootLogDir.getAbsolutePath()); | ||
| LogAggregationService logAggregationService = spy( | ||
| new LogAggregationService(dispatcher, this.context, this.delSrvc, super.dirsHandler)); | ||
| verifyLocalFileDeletion(logAggregationService); | ||
| verifyLocalFileDeletion(logAggregationService, 4321L); | ||
|
||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -344,7 +344,7 @@ public void testLocalFileDeletionOnDiskFull() throws Exception { | |
| LogAggregationService logAggregationService = spy( | ||
| new LogAggregationService(dispatcher, this.context, this.delSrvc, | ||
| dirsHandler)); | ||
| verifyLocalFileDeletion(logAggregationService); | ||
| verifyLocalFileDeletion(logAggregationService, 5678L); | ||
| } | ||
|
|
||
| /* Test to verify fix for YARN-3793 */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some scope to change this hard-coded sleep with
GenericTestUtils.waitFor?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your help reviewing the code, I will use
GenericTestUtils.waitForfor code refactoring.