[jboss-jira] [JBoss JIRA] (DROOLS-1326) Stateful working memory regression OCT-2016: nurserostering long_hint01.xml
Matteo Mortari (JIRA)
issues at jboss.org
Wed Nov 23 04:21:00 EST 2016
[ https://issues.jboss.org/browse/DROOLS-1326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13326834#comment-13326834 ]
Matteo Mortari commented on DROOLS-1326:
----------------------------------------
Using this as a reference and passing test, for A/B testing comparison for the failing test synthetic above. (using the .equals() instead of == in the not node will cause to have the redblacktree working, instead of the hashtable as per the test above)
{code:java}
public class ReferenceTest {
@Test
public void test() {
String drl = "package "+this.getClass().getPackage().getName()+";\n" +
"import "+my.MyPojo.class.getCanonicalName()+"\n" +
"global java.util.Set controlSet;\n" +
"rule R1\n" +
"when\n" +
" $my: MyPojo(\n" +
" vBoolean == true,\n" +
" $s : vString, vString != null,\n" +
" $l : vLong\n" +
" )\n" +
" not MyPojo(\n" +
" vBoolean == true,\n" +
" vString.equals($s),\n" +
" vLong > $l\n" +
" )\n" +
"then\n" +
" System.out.println(\"->> firing with \"+ kcontext.getKieRuntime().getFactHandle($my) );\n" +
" System.out.println(\"->> firing with \"+$l);\n" +
" controlSet.add($l);\n" +
"end";
System.out.println(drl);
KieSession session = new KieHelper().addContent(drl, ResourceType.DRL).build().newKieSession();
Set<Long> check = new HashSet<Long>();
session.setGlobal("controlSet", check);
my.MyPojo a = new my.MyPojo(true, "x", 0, "a");
my.MyPojo b = new my.MyPojo(true, "x", 7, "b");
my.MyPojo c = new my.MyPojo(false, null, 7, "c");
FactHandle fh_a = session.insert(a);
FactHandle fh_b = session.insert(b);
FactHandle fh_c = session.insert(c);
System.out.println("a: "+fh_a);
System.out.println("b: "+fh_b);
System.out.println("c: "+fh_c);
System.out.println("1st fireAllRules");
session.fireAllRules();
assertFalse( check.contains(0) ); // A should be blocked by B.
c.setvBoolean(true); c.setvString("x");
session.update(fh_c, c);
b.setvBoolean(false); b.setvString(null);
session.update(fh_b, b);
System.out.println("2nd fireAllRules");
session.fireAllRules();
assertFalse( check.contains(0L) ); // A is no longer blocked by B, *however* it is now blocked by C !
}
}
{code}
> Stateful working memory regression OCT-2016: nurserostering long_hint01.xml
> ---------------------------------------------------------------------------
>
> Key: DROOLS-1326
> URL: https://issues.jboss.org/browse/DROOLS-1326
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Beta2
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
> Priority: Blocker
> Attachments: screenshot-1.png
>
>
> Something regressed in Drools master between 27-SEP and 11-OCT.
> See:
> https://kie-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/optaplanner-turtleTests/org.optaplanner$optaplanner-examples/73/testReport/junit/org.optaplanner.examples.nurserostering.app/NurseRosteringSolveAllTurtleTest/runFastAndFullAssert_2__data_nurserostering_unsolved_long_hint01_xml_/
> I 'll ask [~jlocker] to isolate.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list