This commit is contained in:
Robert Knutsson 2026-08-01 14:10:19 +03:00 committed by GitHub
commit 60ea4ba0c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import org.apache.cassandra.utils.concurrent.AsyncPromise;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.when;
public class MemtableCleanerThreadTest
@ -111,6 +112,22 @@ public class MemtableCleanerThreadTest
stopThread();
}
@Test
public void testCleanerError() throws Exception
{
when(pool.needsCleaning()).thenReturn(false);
AsyncPromise<Boolean > fut = new AsyncPromise<>();
cleaner = () -> {
return fut;
};
Clean<> clean = new Clean<>(pool, cleaner);
Boolean res = clean.apply(null, null);
assertNull(res);
}
@Test
public void testCleanerError() throws Exception
{