Attempting to fix a flaky test be simplifying it.
@@ -32,6 +32,8 @@ import org.linqs.psl.model.atom.RandomVariableAtom;
import org.linqs.psl.model.formula.Conjunction;
import org.linqs.psl.model.formula.Implication;
import org.linqs.psl.model.predicate.StandardPredicate;
+import org.linqs.psl.model.rule.GroundRule;
+import org.linqs.psl.model.rule.Rule;
import org.linqs.psl.model.rule.arithmetic.WeightedArithmeticRule;
import org.linqs.psl.model.rule.arithmetic.expression.ArithmeticRuleExpression;
import org.linqs.psl.model.rule.arithmetic.expression.SummationAtomOrAtom;
@@ -174,6 +176,9 @@ public class MPEInferenceTest {
public void testLogicalTautologyTrivial() {
TestModel.ModelInformation info = TestModel.getModel();
+ // Clear out the model.
+ info.model.clear();
+
// Friends(A, B) -> Friends(A, B)
info.model.addRule(new WeightedLogicalRule(
new Implication(
@@ -190,9 +195,9 @@ public class MPEInferenceTest {
mpe.inference();
- // There are 20 trivial rules.
- assertEquals(72, mpe.getGroundRuleStore().size());
- assertEquals(52, mpe.getTermStore().size());
+ // There are 20 ground rules, and they are all trivial.
+ assertEquals(20, mpe.getGroundRuleStore().size());
+ assertEquals(0, mpe.getTermStore().size());
mpe.close();
inferDB.close();
