You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andy Seaborne <an...@apache.org> on 2018/08/23 15:58:33 UTC

Intermittent test failure: TestLPBRuleEngine.testSaturateTabledGoals

Intermittent error - but twice today:

Actually, I've seen it before on a completely clean build but redoing 
the build and it wasn't there.

Dave - what does the test do?

Hard to believe the test is in error. At first glance it has no 
non-determinism.

We can always blame recent emergency (= less tested) microcode and OS 
fixes for Meltdown/Spectre/Foreshadow :-)

     Andy

[INFO] Running org.apache.jena.test.TestPackage
[ERROR] Tests run: 8754, Failures: 1, Errors: 0, Skipped: 0, Time 
elapsed: 24.116 s <<< FAILURE! - in org.apache.jena.test.TestPackage
[ERROR] 
testSaturateTabledGoals(org.apache.jena.reasoner.rulesys.impl.TestLPBRuleEngine) 
  Time elapsed: 0.868 s  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<1024> but was:<728>
	at 
org.apache.jena.reasoner.rulesys.impl.TestLPBRuleEngine.testSaturateTabledGoals(TestLPBRuleEngine.java:166)

Re: Intermittent test failure: TestLPBRuleEngine.testSaturateTabledGoals

Posted by Andy Seaborne <an...@apache.org>.
Dave,

Excellent - thank you.

I'll make that change.

     Andy

On 25/08/18 15:27, Dave Reynolds wrote:
> On 23/08/18 16:58, Andy Seaborne wrote:
>> Intermittent error - but twice today:
>>
>> Actually, I've seen it before on a completely clean build but redoing 
>> the build and it wasn't there.
>>
>> Dave - what does the test do?
> 
> Not one of mine, it was added by stain to as part of fixing JENA-901.
> 
> Looks like it's to test that the limit on tabled goal size is being 
> applied. That table used to be unbounded, Stian's fix for 901 was to 
> introduce a Guava bounded cache.
> 
>> Hard to believe the test is in error. At first glance it has no 
>> non-determinism.
> 
> Looks like the bounded cache is set up to use weak references. There's 
> nothing I can see in the test code that forces the references to be held 
> so a carefully time GC could empty or part empty the cache.
> 
> I suspect replacing line 166 in that test:
> 
>      assertEquals(MAX, engine.tabledGoals.size());
> 
> by
> 
>      assertTrue( engine.tabledGoals.size() <= MAX )
> 
> would be enough to preserve the intent of the test (actually bounded) 
> while being insensitive to refs being collected.
> 
> Dave

Re: Intermittent test failure: TestLPBRuleEngine.testSaturateTabledGoals

Posted by Dave Reynolds <da...@gmail.com>.
On 23/08/18 16:58, Andy Seaborne wrote:
> Intermittent error - but twice today:
> 
> Actually, I've seen it before on a completely clean build but redoing 
> the build and it wasn't there.
> 
> Dave - what does the test do?

Not one of mine, it was added by stain to as part of fixing JENA-901.

Looks like it's to test that the limit on tabled goal size is being 
applied. That table used to be unbounded, Stian's fix for 901 was to 
introduce a Guava bounded cache.

> Hard to believe the test is in error. At first glance it has no 
> non-determinism.

Looks like the bounded cache is set up to use weak references. There's 
nothing I can see in the test code that forces the references to be held 
so a carefully time GC could empty or part empty the cache.

I suspect replacing line 166 in that test:

     assertEquals(MAX, engine.tabledGoals.size());

by

     assertTrue( engine.tabledGoals.size() <= MAX )

would be enough to preserve the intent of the test (actually bounded) 
while being insensitive to refs being collected.

Dave