YARN-6747. TestFSAppStarvation.testPreemptionEnable fails intermittently. (Contributed by Miklos Szegedi)
This commit is contained in:
parent
9114d7a5a0
commit
d4811c8cfa
@ -62,6 +62,9 @@ public class TestFSAppStarvation extends FairSchedulerTestBase {
|
|||||||
ALLOC_FILE.getAbsolutePath());
|
ALLOC_FILE.getAbsolutePath());
|
||||||
conf.setBoolean(FairSchedulerConfiguration.PREEMPTION, true);
|
conf.setBoolean(FairSchedulerConfiguration.PREEMPTION, true);
|
||||||
conf.setFloat(FairSchedulerConfiguration.PREEMPTION_THRESHOLD, 0f);
|
conf.setFloat(FairSchedulerConfiguration.PREEMPTION_THRESHOLD, 0f);
|
||||||
|
// This effectively disables the update thread since we call update
|
||||||
|
// explicitly on the main thread
|
||||||
|
conf.setLong(FairSchedulerConfiguration.UPDATE_INTERVAL_MS, Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
@ -124,16 +127,17 @@ public class TestFSAppStarvation extends FairSchedulerTestBase {
|
|||||||
|
|
||||||
// Wait for apps to be processed by MockPreemptionThread
|
// Wait for apps to be processed by MockPreemptionThread
|
||||||
for (int i = 0; i < 6000; ++i) {
|
for (int i = 0; i < 6000; ++i) {
|
||||||
if(preemptionThread.totalAppsAdded() >
|
if(preemptionThread.totalAppsAdded() >=
|
||||||
preemptionThread.uniqueAppsAdded()) {
|
preemptionThread.uniqueAppsAdded() * 2) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Thread.sleep(10);
|
Thread.sleep(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
assertTrue("Each app is marked as starved exactly once",
|
assertEquals("Each app should be marked as starved once" +
|
||||||
preemptionThread.totalAppsAdded() >
|
" at each scheduler update above",
|
||||||
preemptionThread.uniqueAppsAdded());
|
preemptionThread.totalAppsAdded(),
|
||||||
|
preemptionThread.uniqueAppsAdded() * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user