[squeak-dev] The Inbox: KernelTests-jar.418.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Dec 20 20:37:28 UTC 2021


A new version of KernelTests was added to project The Inbox:
http://source.squeak.org/inbox/KernelTests-jar.418.mcz

==================== Summary ====================

Name: KernelTests-jar.418
Author: jar
Time: 20 December 2021, 9:37:26.122961 pm
UUID: 229ac303-0cfa-2d45-8d4e-e2b19b88cba8
Ancestors: KernelTests-ct.415

add a test (expected failure) to document a bug in #priority via a failing test case. The bug was summarized in http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217473.html
and discussed in
http://forum.world.st/The-Inbox-Kernel-jar-1368-mcz-td5126894.html
and most likely requires a new primitive to fix it correctly. An interim fix was proposed in Kernel-jar.1368 to show the desirable functionality that satisfies this test.

=============== Diff against KernelTests-ct.415 ===============

Item was added:
+ ----- Method: ProcessTest>>expectedFailures (in category 'failures') -----
+ expectedFailures
+ 
+ 	^ #(testDecreaseActiveProcessPriority)!

Item was added:
+ ----- Method: ProcessTest>>testDecreaseActiveProcessPriority (in category 'tests') -----
+ testDecreaseActiveProcessPriority
+ 	"test whether #priority: reschedules active process to allow higher priority processes run;
+ 	presently (12/2021) the test fails and is here to remind about the #priority bug discussed 
+ 	in http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-December/217473.html
+ 	and http://forum.world.st/The-Inbox-Kernel-jar-1368-mcz-td5126894.html"
+ 
+ 	| val oldPriority oldPreemptionYields |
+ 	val := nil.
+ 	oldPriority := Processor activePriority.
+ 	oldPreemptionYields := Smalltalk processPreemptionYields.
+ 
+ 	[
+ 		Processor activeProcess priority: oldPriority + 2.
+ 		[ val := false ] forkAt: oldPriority + 1.
+ 		[ val := true ] forkAt: oldPriority.
+ 		Processor activeProcess priority: oldPriority.
+ 		"depending on processPreemptionYields value the active process should be placed
+ 		either at the beginning or the end of the quiescentProcessLists at: oldPriority"
+ 		self assert: val = Smalltalk processPreemptionYields.
+ 
+ 		"test both alternative settings (true/false) of processPreemptionYields"
+ 		val := nil.
+ 		Smalltalk processPreemptionYields: oldPreemptionYields not.
+ 	
+ 		Processor activeProcess priority: oldPriority + 2.
+ 		[ val := false ] forkAt: oldPriority + 1.
+ 		[ val := true ] forkAt: oldPriority.
+ 		Processor activeProcess priority: oldPriority.
+ 		self assert: val = Smalltalk processPreemptionYields.
+ 
+ 	] ensure: [
+ 		"make sure processPreemptionYields is reset to its original value even if the test fails"
+ 		Smalltalk processPreemptionYields: oldPreemptionYields.
+ 		self assert: Smalltalk processPreemptionYields equals: oldPreemptionYields]!



More information about the Squeak-dev mailing list