Login  Register

The Inbox: KernelTests-jar.406.mcz

Posted by commits-2 on May 24, 2021; 9:02pm
URL: https://forum.world.st/The-Inbox-KernelTests-jar-406-mcz-tp5129984.html

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

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

Name: KernelTests-jar.406
Author: jar
Time: 24 May 2021, 11:02:39.394885 pm
UUID: 08657090-5a49-f84b-904f-8a37f5f2ec75
Ancestors: KernelTests-jar.405

Test a situation when a process terminating another process is terminated in the middle of the unwind. make sure both processes are unwound correctly.

=============== Diff against KernelTests-jar.405 ===============

Item was added:
+ ----- Method: ProcessTest>>testTerminateInTerminate (in category 'tests') -----
+ testTerminateInTerminate
+ "Terminating a terminator process should unwind both the terminator and its terminatee process"
+
+ | terminator terminatee unwound |
+ unwound := false.
+ terminatee := [[Processor activeProcess suspend] ensure: [unwound := true]] fork.
+ Processor yield.
+ terminator := [terminatee terminate] newProcess.
+ self assert: terminatee isSuspended.
+ self assert: terminator isSuspended.
+ terminator runUntil: [:ctx | ctx selectorToSendOrSelf = #suspend]. "first #suspend in #terminate"
+ self assert: terminator isSuspended.
+ terminator terminate.
+ self assert: terminator isTerminated.
+ self assert: unwound!