[Pkg] The Trunk: ToolsTests-ct.107.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Dec 16 01:38:57 UTC 2021


Christoph Thiede uploaded a new version of ToolsTests to project The Trunk:
http://source.squeak.org/trunk/ToolsTests-ct.107.mcz

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

Name: ToolsTests-ct.107
Author: ct
Time: 16 December 2021, 2:29:44.341664 am
UUID: 6b771eec-03fe-0a4d-91c9-50480d259573
Ancestors: ToolsTests-mt.106

Complements Kernel-ct.1434 (revised termination modi on Process). Adds end-to-end tests for abandoning vs. terminating a debugger inside an active unwind context. Makes proper use of new termination modi in clean-ups for other tests.

=============== Diff against ToolsTests-mt.106 ===============

Item was changed:
  ----- Method: DebuggerTests>>tearDown (in category 'running') -----
  tearDown
  
  	debugger ifNotNil: [debugger close].
+ 	process ifNotNil: [process terminateAggressively].
- 	process ifNotNil: [process terminate].
  	
  	process := nil.
  	debugger := nil.
  	window := nil.
  
  	reset do: #value.	
  	
  	super tearDown.!

Item was changed:
  ----- Method: DebuggerTests>>test16HandleSimulationError (in category 'tests') -----
  test16HandleSimulationError
  	"Regression test. In the past, the scenario below led to an infinite debugger chain freezing your image. Be careful when running this test in an unpatched image!! For more information, see http://forum.world.st/I-broke-the-debugger-td5110752.html."
  
  	| userProcess |
  	process := Process forBlock: [
  		"the faulty user code"
  		thisContext pc: nil].
  	debugger := process debug.
  	
  	[userProcess := [debugger stepThrough] fork.
  	Processor yield.
  	
  	self deny: [process isTerminated].
  	self assert: [userProcess isSuspended]]
  		
  		ensure: [
+ 			process destroy.
- 			process suspendedContext: nil; terminate.
  			debugger close.
  			process := userProcess.
  			self findDebugger "for correct tearDown"].!

Item was changed:
  ----- Method: DebuggerTests>>test17HandleBlockCannotReturn (in category 'tests') -----
  test17HandleBlockCannotReturn
  	"Regression test. In the past, the scenario below led to an infinite debugger chain freezing your image. Be careful when running this test in an unpatched image!! For more information, see http://forum.world.st/I-broke-the-debugger-td5110752.html."
  
  	| userProcess |
  	process := Process forBlock: [
  		"the faulty user code"
  		[] ensure: [thisContext privSender: nil]].
  	debugger := process debug.
  	
  	[userProcess := [debugger stepOver] fork.
  	Processor yield.
  	
  	self assert: [process isTerminated].
  	self deny: [userProcess isRunnable]]
  		
  		ensure: [
+ 			process terminateAggressively.
- 			process terminate.
  			debugger close.
  			process := userProcess.
  			self findDebugger "for correct tearDown"].!

Item was changed:
  ----- Method: DebuggerTests>>test18HandleNestedBlockCannotReturn (in category 'tests') -----
  test18HandleNestedBlockCannotReturn
  	"Regression test. In the past, the scenario below led to an infinite debugger chain freezing your image. Be careful when running this test in an unpatched image!! For more information, see http://forum.world.st/I-broke-the-debugger-td5110752.html."
  
  	| metaProcess metaDebugger userProcess |
  	process := Process forBlock: [
  		"the faulty user code"
  		[] ensure: [thisContext privSender: nil]].
  	debugger := process debug.
  	metaProcess := Process forBlock: [
  		debugger stepOver].
  	metaDebugger := metaProcess debug.
  	
  	[userProcess := [metaDebugger stepOver] fork.
  	Processor yield.
  	
  	self assert: [process isTerminated].
  	self deny: [userProcess isRunnable]]
  		
  		ensure: [
+ 			process terminateAggressively.
- 			process terminate.
  			debugger close.
+ 			metaProcess terminateAggressively.
- 			metaProcess terminate.
  			metaDebugger close.
  			process := userProcess.
  			self findDebugger "for correct tearDown"].!

Item was added:
+ ----- Method: DebuggerTests>>test19Abandon (in category 'tests') -----
+ test19Abandon
+ 	"When the debugger is abandoned, the interrupted process is terminated aggressively, i.e., all not yet started unwind contexts are executed. Further errors that occur during unwinding lead to another debugger showing up. This is the acceptance test equivalent for ProcessTest >> #testTerminateNestedUnwindAggressively."
+ 
+ 	| x y z userProcess |
+ 	process := Process
+ 		forBlock:
+ 			[x := 1.
+ 			[y := 1.
+ 			self error: #first.
+ 			y := 2] ensure:
+ 				[z := 1.
+ 				self error: #second.
+ 				z := 2].
+ 			x := 2]
+ 		runUntil: [:ctx | y = 1].
+ 	self should: {x. y. z} = {1. 1. nil}.
+ 	debugger := process debug.
+ 	
+ 	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
+ 	Processor yield.
+ 	self findDebugger.
+ 	
+ 	self deny: process isTerminated.
+ 	self assert: userProcess isTerminated.
+ 	self deny: debugger isNil.
+ 	self assert: {1. 1. nil} equals: {x. y. z}.
+ 	self assert: (debugger containingWindow label includesSubstring: #first).
+ 	
+ 	userProcess := [debugger abandon] forkAt: Processor activePriority + 1.
+ 	Processor yield.
+ 	self findDebugger.
+ 	
+ 	self deny: process isTerminated.
+ 	self assert: userProcess isTerminated.
+ 	self deny: debugger isNil.
+ 	self assert: {1. 1. 1} equals: {x. y. z}.
+ 	self assert: (debugger containingWindow label includesSubstring: #second).
+ 	
+ 	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
+ 	Processor yield.
+ 	self findDebugger.
+ 	
+ 	self assert: process isTerminated.
+ 	self assert: userProcess isTerminated.
+ 	self assert: debugger isNil.
+ 	self assert: {1. 1. 2} equals: {x. y. z}.!

Item was added:
+ ----- Method: DebuggerTests>>test20TerminateProcess (in category 'tests') -----
+ test20TerminateProcess
+ 	"When the debugger's process is terminated, all unwind contexts, including already entered ones, are executed. Further errors that occur during unwinding lead to another debugger showing up. This is the acceptance test equivalent for ProcessTest >> #testTerminateNestedUnwind."
+ 
+ 	| x y z userProcess |
+ 	process := Process
+ 		forBlock:
+ 			[x := 1.
+ 			[y := 1.
+ 			self error: #first.
+ 			y := 2] ensure:
+ 				[z := 1.
+ 				self error: #second.
+ 				z := 2].
+ 			x := 2]
+ 		runUntil: [:ctx | y = 1].
+ 	self should: {x. y. z} = {1. 1. nil}.
+ 	debugger := process debug.
+ 	
+ 	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
+ 	Processor yield.
+ 	self findDebugger.
+ 	
+ 	self deny: process isTerminated.
+ 	self assert: userProcess isTerminated.
+ 	self deny: debugger isNil.
+ 	self assert: {1. 1. nil} equals: {x. y. z}.
+ 	self assert: (debugger containingWindow label includesSubstring: #first).
+ 	
+ 	userProcess := [debugger terminateProcess] forkAt: Processor activePriority + 1.
+ 	Processor yield.
+ 	self findDebugger.
+ 	
+ 	self deny: process isTerminated.
+ 	self assert: userProcess isTerminated.
+ 	self deny: debugger isNil.
+ 	self assert: {1. 2. 1} equals: {x. y. z}.
+ 	self assert: (debugger containingWindow label includesSubstring: #second).
+ 	
+ 	userProcess := [debugger proceed] forkAt: Processor activePriority + 1.
+ 	Processor yield.
+ 	self findDebugger.
+ 	
+ 	self assert: process isTerminated.
+ 	self assert: userProcess isTerminated.
+ 	self assert: debugger isNil.
+ 	self assert: {2. 2. 2} equals: {x. y. z}.!



More information about the Packages mailing list