Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ar.159.mcz==================== Summary ====================
Name: CollectionsTests-ar.159
Author: ar
Time: 6 April 2010, 10:32:28.656 pm
UUID: 2972a556-752d-9849-bfde-86dc1baa9277
Ancestors: CollectionsTests-ul.158
Make WeakRegistryTest>>testFinalization be more reliable.
=============== Diff against CollectionsTests-ul.158 ===============
Item was changed:
----- Method: WeakRegistryTest>>testFinalization (in category 'tests') -----
testFinalization
| w finalized block object |
w := WeakRegistry new: 1.
finalized := false.
block := [ :v | finalized := v ].
object := ObjectFinalizer "an object that responds to #finalize"
receiver: block
selector: #value:
argument: true.
w add: object.
object := nil. "let it go"
Smalltalk garbageCollect. "finalize it"
+
+ "This is an odd issue. It seems that in some situations the finalization
+ process doesn't run 'in time' for the isEmpty assertion below to succeed.
+ This really *shouldn't* happen since isEmpty is full of real sends and
+ there ought to be an interrupt check in there somewhere. However,
+ since there are no real-time guarantees about finalization, it's fair to
+ just wait a little to ensure that the finalization process has been run."
+ (Delay forMilliseconds: 100) wait.
+
self assert: w isEmpty.
self assert: finalized!