[squeak-dev] The Trunk: CollectionsTests-ar.159.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 7 05:32:56 UTC 2010

Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:

==================== 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') -----
  	| 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!

More information about the Squeak-dev mailing list