[squeak-dev] The Inbox: Tests-jar.448.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Apr 12 21:13:15 UTC 2021


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

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

Name: Tests-jar.448
Author: jar
Time: 12 April 2021, 11:13:13.58946 pm
UUID: 99c6f69a-288c-0648-80af-3b7aa014e9ba
Ancestors: Tests-nice.447

Complement Kernel-jar.1386 (Fix a list of termination bugs described in http://forum.world.st/Solving-multiple-termination-bugs-summary-amp-proposal-td5128285.html)

These basic tests illustrate the unwind semantics during termination implemented by the new #teminate..

Current implementation of #teminate will fail with these tests - they should accompany Kernel-jar.1386 (if accepted).

Thanks

=============== Diff against Tests-nice.447 ===============

Item was changed:
  SystemOrganization addCategory: #'Tests-Bugs'!
  SystemOrganization addCategory: #'Tests-Compiler'!
  SystemOrganization addCategory: #'Tests-Dependencies'!
  SystemOrganization addCategory: #'Tests-Digital Signatures'!
  SystemOrganization addCategory: #'Tests-Environments'!
  SystemOrganization addCategory: #'Tests-Exceptions'!
  SystemOrganization addCategory: #'Tests-FilePackage'!
  SystemOrganization addCategory: #'Tests-Files'!
  SystemOrganization addCategory: #'Tests-Finalization'!
  SystemOrganization addCategory: #'Tests-Hex'!
  SystemOrganization addCategory: #'Tests-Installer-Core'!
  SystemOrganization addCategory: #'Tests-Localization'!
  SystemOrganization addCategory: #'Tests-Monticello'!
  SystemOrganization addCategory: #'Tests-Monticello-Mocks'!
  SystemOrganization addCategory: #'Tests-Monticello-Utils'!
  SystemOrganization addCategory: #'Tests-Object Events'!
  SystemOrganization addCategory: #'Tests-ObjectsAsMethods'!
  SystemOrganization addCategory: #'Tests-PrimCallController'!
  SystemOrganization addCategory: #'Tests-Release'!
  SystemOrganization addCategory: #'Tests-System-Applications'!
  SystemOrganization addCategory: #'Tests-System-Digital Signatures'!
  SystemOrganization addCategory: #'Tests-System-Object Storage'!
  SystemOrganization addCategory: #'Tests-System-Preferences'!
  SystemOrganization addCategory: #'Tests-System-Support'!
  SystemOrganization addCategory: #'Tests-Utilities'!
  SystemOrganization addCategory: #'Tests-VM'!
- SystemOrganization addCategory: #'Tests-MonticelloMocks'!
  SystemOrganization addCategory: #'Tests-Sound'!

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind1 (in category 'tests') -----
+ testTerminationDuringNestedUnwind1
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 |
+ 	x1 := x2 := x3 := false.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[Processor activeProcess suspend] ensure: [
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p is suspended and none of the unwind blocks has finished yet"
+ 	self assert: p isSuspended.
+ 	self deny: x1 | x2 | x3.
+ 	"now terminate the process and make sure all unwind blocks have finished"
+ 	p terminate.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind2 (in category 'tests') -----
+ testTerminationDuringNestedUnwind2
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 |
+ 	x1 := x2 := x3 := false.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[ ] ensure: [
+ 						Processor activeProcess suspend. 
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p is suspended and none of the unwind blocks has finished yet"
+ 	self assert: p isSuspended.
+ 	self deny: x1 | x2 | x3.
+ 	"now terminate the process and make sure all unwind blocks have finished"
+ 	p terminate.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind3 (in category 'tests') -----
+ testTerminationDuringNestedUnwind3
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 |
+ 	x1 := x2 := x3 := false.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[Processor yield] ensure: [
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p is runnable and none of the unwind blocks has finished yet"
+ 	self assert: p isRunnable.
+ 	self deny: x1 | x2 | x3.
+ 	"now terminate the process and make sure all unwind blocks have finished"
+ 	p terminate.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind4 (in category 'tests') -----
+ testTerminationDuringNestedUnwind4
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 |
+ 	x1 := x2 := x3 := false.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[ ] ensure: [
+ 						Processor yield. 
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p is suspended and none of the unwind blocks has finished yet"
+ 	self assert: p isRunnable.
+ 	self deny: x1 | x2 | x3.
+ 	"now terminate the process and make sure all unwind blocks have finished"
+ 	p terminate.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind5 (in category 'tests') -----
+ testTerminationDuringNestedUnwind5
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 |
+ 	x1 := x2 := x3 := false.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[Processor activeProcess terminate] ensure: [
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p suspended itself and none of the unwind blocks has finished yet"
+ 	self assert: p isSuspended.
+ 	self deny: x1 | x2 | x3.
+ 	"now let the termination continue and make sure all unwind blocks have finished"
+ 	Processor yield.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind6 (in category 'tests') -----
+ testTerminationDuringNestedUnwind6
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 |
+ 	x1 := x2 := x3 := false.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[ ] ensure: [
+ 						Processor activeProcess terminate.
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p suspended itself and none of the unwind blocks has finished yet"
+ 	self assert: p isSuspended.
+ 	self deny: x1 | x2 | x3.
+ 	"now let the termination continue and make sure all unwind blocks have finished"
+ 	Processor yield.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind7 (in category 'tests') -----
+ testTerminationDuringNestedUnwind7
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 semaphore |
+ 	x1 := x2 := x3 := false.
+ 	semaphore := Semaphore new.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[semaphore wait] ensure: [
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p is runnable and none of the unwind blocks has finished yet"
+ 	self assert: p isBlocked.
+ 	self deny: x1 | x2 | x3.
+ 	"now terminate the process and make sure all unwind blocks have finished"
+ 	p terminate.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !

Item was added:
+ ----- Method: ProcessTerminateBug>>testTerminationDuringNestedUnwind8 (in category 'tests') -----
+ testTerminationDuringNestedUnwind8
+ 	"Test all nested unwind blocks are correctly unwound; 
+ 	all unwind blocks halfway 	through their execution should be completed."
+ 
+ 	| p x1 x2 x3 semaphore |
+ 	x1 := x2 := x3 := false.
+ 	semaphore := Semaphore new.
+ 	p := 
+ 		[
+ 			[
+ 				[ ] ensure: [
+ 					[ ] ensure: [
+ 						semaphore wait.
+ 						x1 := true]. 
+ 					x2 := true]
+ 			] ensure: [
+ 				x3 := true]
+ 		] newProcess resume.
+ 	Processor yield.
+ 	"make sure p is runnable and none of the unwind blocks has finished yet"
+ 	self assert: p isBlocked.
+ 	self deny: x1 | x2 | x3.
+ 	"now terminate the process and make sure all unwind blocks have finished"
+ 	p terminate.
+ 	self assert: p isTerminated.
+ 	self assert: x1 & x2 & x3
+ !



More information about the Squeak-dev mailing list