HBASE-23956 Use less resources running tests (#1266)

Addendum: This test was depending on hard-coded number for
log cleaners; the parent patch made them less in test context.
This commit is contained in:
stack 2020-03-11 20:33:00 -07:00
parent 08603f02ea
commit 789a8b7c44
1 changed files with 3 additions and 3 deletions

View File

@ -298,7 +298,7 @@ public class TestLogsCleaner {
FileSystem fs = TEST_UTIL.getDFSCluster().getFileSystem();
LogCleaner cleaner = new LogCleaner(3000, server, conf, fs, OLD_WALS_DIR, POOL);
assertEquals(LogCleaner.DEFAULT_OLD_WALS_CLEANER_THREAD_SIZE, cleaner.getSizeOfCleaners());
int size = cleaner.getSizeOfCleaners();
assertEquals(LogCleaner.DEFAULT_OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC,
cleaner.getCleanerThreadTimeoutMsec());
// Create dir and files for test
@ -313,10 +313,10 @@ public class TestLogsCleaner {
// change size of cleaners dynamically
int sizeToChange = 4;
long threadTimeoutToChange = 30 * 1000L;
conf.setInt(LogCleaner.OLD_WALS_CLEANER_THREAD_SIZE, sizeToChange);
conf.setInt(LogCleaner.OLD_WALS_CLEANER_THREAD_SIZE, size + sizeToChange);
conf.setLong(LogCleaner.OLD_WALS_CLEANER_THREAD_TIMEOUT_MSEC, threadTimeoutToChange);
cleaner.onConfigurationChange(conf);
assertEquals(sizeToChange, cleaner.getSizeOfCleaners());
assertEquals(sizeToChange + size, cleaner.getSizeOfCleaners());
assertEquals(threadTimeoutToChange, cleaner.getCleanerThreadTimeoutMsec());
// Stop chore
thread.join();