You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefano Bagnara <ap...@bago.org> on 2008/08/29 15:30:08 UTC

[javaflow] wrong assertions in AbstractSimpleTestCase

Hi all,

i looked in depth in some test failure for javaflow and I think some of 
them are bugs in the test suite and not in the code.

E.g:

1) the class ClassAccess2.java does not have a  Continuation.suspend() 
so it is ok that the caller does not fine a Continuation. Adding a 
Continuation.suspend before returning fixed the issue.

2) AbstractSimpleTestCase expects the wrong results for the try/catch issue.
2A) testSimpleTryCatchWithoutException expect 3 continuations (note the 
last assertTrue(c != null)) but this is wrong. When no exception happen 
the continuations will be 2.
2B) testSimpleTryCatchWithException expect 3 continuations, expect the 
wrong result on the 3rd and does not complete/test the last continuation.

Am I totally wrong or they are issues in the test suite?
Should I open a JIRA for this and attach a patch?

AFAICT the try/catch test works fine once the testsuite assertions have 
been corrected, the only failure is on the synchronized-test.

About the synchronized block and the illegal monitor i'm not sure I 
understand how it should work.. should javaflow keep the lock open 
during the suspension or tracking the locked objects and try to lock 
them again on resume?	

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [javaflow] wrong assertions in AbstractSimpleTestCase

Posted by Stefano Bagnara <ap...@bago.org>.
Torsten Curdt ha scritto:
>> Am I totally wrong or they are issues in the test suite?
> 
> Will have a closer look when I am back from vacation. About to walk out 
> the door. Back online in two weeks.

So you should be back, or you should do soon.. Hope you are relaxed 
because I prepared some work for you ;-)

>> Should I open a JIRA for this and attach a patch?
> 
> Sounds good :)

Here we are:

- https://issues.apache.org/jira/browse/SANDBOX-253
Fix pom dependencies (update asm to latest 2.x and fix jci to a 
non-snapshot)

- https://issues.apache.org/jira/browse/SANDBOX-254
wrong expectations in failing junit tests (SimpleTestCase)

- https://issues.apache.org/jira/browse/SANDBOX-255
synchronized(obj) support is missing (locks are not released when 
suspending resulting in IllegalMonitorExceptions)

>> AFAICT the try/catch test works fine once the testsuite assertions 
>> have been corrected, the only failure is on the synchronized-test.
> 
> Hm

Please, have a look at SANDBOX-254. I hope I understood enough of 
javaflow and that the patch is good!

>> About the synchronized block and the illegal monitor i'm not sure I 
>> understand how it should work.. should javaflow keep the lock open 
>> during the suspension or tracking the locked objects and try to lock 
>> them again on resume?   
> 
> No. The lock needs to be released.

Done in SANDBOX-255. Please review.
I had to introduce a new Frame extension "MonitoringFrame" that also 
take care of tracking monitorenter/monitorexit so in any given frame it 
knows what local variables are locked.
The test included in javaflow and a more advanced test I wrote for it 
seems to work, but I'm sure you can think of better tests that can prove 
limits for this approach.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [javaflow] wrong assertions in AbstractSimpleTestCase

Posted by Torsten Curdt <tc...@apache.org>.
> Am I totally wrong or they are issues in the test suite?

Will have a closer look when I am back from vacation. About to walk  
out the door. Back online in two weeks.

> Should I open a JIRA for this and attach a patch?

Sounds good :)

> AFAICT the try/catch test works fine once the testsuite assertions  
> have been corrected, the only failure is on the synchronized-test.

Hm

> About the synchronized block and the illegal monitor i'm not sure I  
> understand how it should work.. should javaflow keep the lock open  
> during the suspension or tracking the locked objects and try to lock  
> them again on resume?	

No. The lock needs to be released.

Sorry ...later!

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org