Hi Marcus: On 22 Jan 2010, at 09:59, Marcus Denker wrote:
On Jan 22, 2010, at 12:39 AM, Stefan Marr wrote:
Hi:
Have currently a lot of trouble with tests which are just deadlocking.
Here is quick hack which specifies a timeout for test cases. Maybe it is useful for others, too. Any suggestions for improvement are welcome.
maybe you can use #valueWithin:onTimeout: ? This is defined on blocks.
Ok, then it looks like: runCase "STEFAN: Added simple hack to 'detect' deadlocks" Author ifUnknownAuthorUse: 'TestRunner' during: [ [ [self setUp. self performTest.] valueWithin: self expectedMaxRuntime onTimeout: [ self failWithTimeout. ]] ensure: [ self tearDown. self cleanUpInstanceVariables ] ] And works fine, too. Thanks Stefan
"Evaluate the receiver. If the evaluation does not complete in less than aDuration evaluate the timeoutBlock instead"
Marcus
-- Marcus Denker -- http://www.marcusdenker.de INRIA Lille -- Nord Europe. Team RMoD.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 3956 Fax: +32 2 629 3525