[squeak-dev] The Trunk: Tests-mt.488.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue May 31 13:27:38 UTC 2022
Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-mt.488.mcz
==================== Summary ====================
Name: Tests-mt.488
Author: mt
Time: 31 May 2022, 3:27:37.152029 pm
UUID: 79004a69-f3a7-b342-8257-59f21a42d5dd
Ancestors: Tests-mt.487
Complements KernelTests-mt.424
=============== Diff against Tests-mt.487 ===============
Item was removed:
- TestCase subclass: #ProcessTerminateBug
- instanceVariableNames: ''
- classVariableNames: ''
- poolDictionaries: ''
- category: 'Tests-Exceptions'!
Item was removed:
- ----- Method: ProcessTerminateBug>>testSchedulerTermination (in category 'tests') -----
- testSchedulerTermination
- | process sema gotHere sema2 |
- gotHere := false.
- sema := Semaphore new.
- sema2 := Semaphore new.
- process := [
- sema signal.
- sema2 wait.
- "will be suspended here"
- gotHere := true. "e.g., we must *never* get here"
- ] forkAt: Processor activeProcess priority.
- sema wait. "until process gets scheduled"
- process terminate.
- sema2 signal.
- Processor yield. "will give process a chance to continue and
- horribly screw up"
- self assert: gotHere not.
- !
Item was removed:
- ----- Method: ProcessTerminateBug>>testTerminationDuringUnwind (in category 'tests') -----
- testTerminationDuringUnwind
- "An illustration of the issue of process termination during unwind.
- This uses a well-behaved unwind block that we should allow to complete
- if at all possible."
- | unwindStarted unwindFinished p |
- unwindStarted := unwindFinished := false.
- p := [[] ensure:[
- unwindStarted := true.
- Processor yield.
- unwindFinished := true.
- ]] fork.
- self deny: unwindStarted.
- Processor yield.
- self assert: unwindStarted.
- self deny: unwindFinished.
- p terminate.
- self assert: unwindFinished.!
Item was removed:
- ----- Method: ProcessTerminateBug>>testUnwindFromActiveProcess (in category 'tests') -----
- testUnwindFromActiveProcess
- | sema process |
- sema := Semaphore forMutualExclusion.
- self assert:(sema isSignaled).
- process := [
- sema critical:[
- self deny: sema isSignaled.
- Processor activeProcess terminate.
- ]
- ] forkAt: Processor userInterruptPriority.
- self assert: sema isSignaled.!
Item was removed:
- ----- Method: ProcessTerminateBug>>testUnwindFromForeignProcess (in category 'tests') -----
- testUnwindFromForeignProcess
- | sema process |
- sema := Semaphore forMutualExclusion.
- self assert: sema isSignaled.
- process := [
- sema critical:[
- self deny: sema isSignaled.
- sema wait. "deadlock"
- ]
- ] forkAt: Processor userInterruptPriority.
- self deny: sema isSignaled.
- "This is for illustration only - the BlockCannotReturn cannot
- be handled here (it's truncated already)"
- self shouldnt: [process terminate] raise: BlockCannotReturn.
- self assert: sema isSignaled.
- !
More information about the Squeak-dev
mailing list
|