RulesIT: Evict cached results instead of disabling cache

Change-Id: I40d5cf441ec43b116eadc18b512558422342f3ff
This commit is contained in:
Patrick Hiesel
2020-04-16 15:41:19 +02:00
parent aadc4a7548
commit 93486e0ccf

View File

@@ -29,7 +29,6 @@ import com.google.inject.Inject;
import java.util.Collection;
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.Repository;
import org.junit.Before;
import org.junit.Test;
/**
@@ -44,14 +43,6 @@ public class RulesIT extends AbstractDaemonTest {
@Inject private ProjectOperations projectOperations;
@Inject private SubmitRuleEvaluator.Factory evaluatorFactory;
@Before
public void setUp() {
// We don't want caches to interfere with our tests. If we didn't, the cache would take
// precedence over the index, which would never be called.
baseConfig.setString("cache", "changes", "memoryLimit", "0");
baseConfig.setString("cache", "projects", "memoryLimit", "0");
}
@Test
public void testUnresolvedCommentsCountPredicate() throws Exception {
modifySubmitRules("gerrit:unresolved_comments_count(0)");
@@ -119,5 +110,6 @@ public class RulesIT extends AbstractDaemonTest {
.message("Modify rules.pl")
.create();
}
projectCache.evict(project);
}
}