[squeak-dev] The Trunk: Tests-jar.466.mcz

Jaromir Matas mail at jaromir.net
Tue Jun 14 09:31:50 UTC 2022


ToolsTests-jar.109 – I’d leave it because they pass now and I know I still have to take a closer look at them (23 & 24 as expected failures is a reminder for me; they should work but something’s wrong with the design of the tests).

Tests-jar.476 – the test is valid, it’s working and is already in Trunk. I just noticed it still sits in the Inbox at the same time, no idea how come.

Otherwise all my clutter is gone, thanks a lot!

From: Marcel Taeumel<mailto:marcel.taeumel at hpi.de>
Sent: Tuesday, June 14, 2022 11:20
To: squeak-dev<mailto:squeak-dev at lists.squeakfoundation.org>
Subject: Re: [squeak-dev] The Trunk: Tests-jar.466.mcz

Done, but "ToolsTests-jar.109" is already in Trunk.

What about "Tests-jar.476"?

Best,
Marcel

Am 14.06.2022 10:35:47 schrieb Jaromir Matas <mail at jaromir.net>:
Hi Marcel,
I’m afraid this version is already outdated; I’ve sent you a mail “Inbox cleanup” with a list of my Inbox stuff that can go to Treated:

Kernel-jar.1421 (stepOver bug - orig + flags)
Kernel-jar.1415 (stepOver bug - better)
Kernel-jar.1399 (exception return - not urgent)
Kernel-jar.1368 (#priority bug)
KernelTests-jar.393 (#priority bug - test)
Tools-jar.1159 (debugger closing bug Christoph)
ToolsTests-jar.110 (test19&20 - wrong ancestry to 109)
ToolsTests-jar.109 (debugger termination tests 21-24)
Tests-jar.466 (unwind tests)

The only contributions still relevant are:
Kernel-jar.1480 (stepOver bug - latest)
Kernel-jar.1445 (#restart - simplify method)
KernelTests-jar.418 (#priority bug - expected failure)

Apologies for any inconvenience; I’d like to declutter not to cause any more confusion :)
Thanks a lot,
jaromir

From: commits at source.squeak.org<mailto:commits at source.squeak.org>
Sent: Tuesday, June 14, 2022 10:30
To: squeak-dev at lists.squeakfoundation.org<mailto:squeak-dev at lists.squeakfoundation.org>; packages at lists.squeakfoundation.org<mailto:packages at lists.squeakfoundation.org>
Subject: [squeak-dev] The Trunk: Tests-jar.466.mcz

Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-jar.466.mcz

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

Name: Tests-jar.466
Author: jar
Time: 31 May 2021, 11:29:34.089017 pm
UUID: 3f2953a1-9d10-a044-88af-c9019346c388
Ancestors: Tests-jar.463

Add a set of tests for nested unwind semantics during termination. Complement latest #terminate in the Inbox.

Supersede Tests-jar.465 - add a small improvement - terminate from a helper process

=============== Diff against Tests-jar.463 ===============

Item was added:
+ TestCase subclass: #ProcessTerminateUnwindTests
+        instanceVariableNames: ''
+        classVariableNames: ''
+        poolDictionaries: ''
+        category: 'Tests-Exceptions'!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminateEnsureAsTopContext (in category 'tests') -----
+ testTerminateEnsureAsTopContext
+        "Test #ensure unwind block is executed even when #ensure context is on stack's top."
+
+        | p1 p2 p3 x1 x2 x3 |
+        x1 := x2 := x3 := false.
+
+        "p1 is at the beginning of the ensure block and the unwind block hasn't run yet"
+        p1 := Process
+                forBlock: [[] ensure: [x1 := x1 not]]
+                runUntil: [:ctx | ctx isUnwindContext and: [(ctx tempAt: 2) isNil]].
+
+        "p2 has already set complete to true (tempAt: 2) but the unwind block hasn't run yet"
+        p2 := Process
+                forBlock: [[] ensure: [x2 := x2 not]]
+                runUntil: [:ctx | ctx isUnwindContext and: [(ctx tempAt: 2) notNil]].
+
+        "p3 has already set complete to true AND the unwind block has run already run;
+        we have to verify the unwind block is not executed again during termination"
+        p3 := Process
+                forBlock: [[] ensure: [x3 := x3 not]]
+                runUntil: [:ctx | ctx isUnwindContext and: [ctx willReturn]].
+
+        "make sure all processes are running and only the p3's unwind block has finished"
+        self deny: p1 isTerminated | p2 isTerminated | p3 isTerminated.
+        self deny: x1 | x2.
+        self assert: x3. "p3 has already run its unwind block; we test it won't run it again"
+        "terminate all processes and verify all unwind blocks have finished correctly"
+        p1 terminate. p2 terminate. p3 terminate.
+        self assert: p1 isTerminated & p2 isTerminated & p3 isTerminated.
+        self assert: x1 & x2 & x3!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind1 (in category 'tests') -----
+ testTerminationDuringNestedUnwind1
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [Processor activeProcess suspend] ensure: [
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind2 (in category 'tests') -----
+ testTerminationDuringNestedUnwind2
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [ ] ensure: [
+                                                Processor activeProcess suspend.
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind3 (in category 'tests') -----
+ testTerminationDuringNestedUnwind3
+        "Terminate runnable process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [Processor yield] ensure: [
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind4 (in category 'tests') -----
+ testTerminationDuringNestedUnwind4
+        "Terminate runnable process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [ ] ensure: [
+                                                Processor yield.
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind5 (in category 'tests') -----
+ testTerminationDuringNestedUnwind5
+        "Terminate active process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [Processor activeProcess terminate] ensure: [
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now let the termination continue and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind6 (in category 'tests') -----
+ testTerminationDuringNestedUnwind6
+        "Terminate active process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [ ] ensure: [
+                                                Processor activeProcess terminate.
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now let the termination continue and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind7 (in category 'tests') -----
+ testTerminationDuringNestedUnwind7
+        "Terminate blocked process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 semaphore |
+        x1 := x2 := x3 := x4 := false.
+        semaphore := Semaphore new.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [semaphore wait] ensure: [
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwind8 (in category 'tests') -----
+ testTerminationDuringNestedUnwind8
+        "Terminate blocked process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 semaphore |
+        x1 := x2 := x3 := x4 := false.
+        semaphore := Semaphore new.
+        p :=
+                [
+                        [
+                                [ ] ensure: [
+                                        [ ] ensure: [
+                                                semaphore wait.
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn1 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn1
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [Processor activeProcess suspend] ensure: [
+                                                x1 := true. return value].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x3.
+        self deny: x2 & x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn2 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn2
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [] ensure: [
+                                                Processor activeProcess suspend.
+                                                x1 := true. return value].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x3.
+        self deny: x2 & x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn3 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn3
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [Processor activeProcess suspend] ensure: [
+                                                x1 := true].
+                                        x2 := true. return value]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn4 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn4
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [] ensure: [
+                                                Processor activeProcess suspend.
+                                                x1 := true].
+                                        x2 := true. return value]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn5 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn5
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [Processor activeProcess suspend] ensure: [
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true. return value].
+                        x4 := true.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn6 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn6
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [] ensure: [
+                                                Processor activeProcess suspend.
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true. return value].
+                        x4 := true.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn7 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn7
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [Processor activeProcess suspend] ensure: [
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true. return value.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!

Item was added:
+ ----- Method: ProcessTerminateUnwindTests>>testTerminationDuringNestedUnwindWithReturn8 (in category 'tests') -----
+ testTerminationDuringNestedUnwindWithReturn8
+        "Terminate suspended process.
+        Test all nested unwind blocks are correctly unwound;
+        all unwind blocks halfway through their execution should be completed."
+
+        | p x1 x2 x3 x4 |
+        x1 := x2 := x3 := x4 := false.
+        p :=
+        [
+                [:return |
+                        [
+                                [ ] ensure: [
+                                        [] ensure: [
+                                                Processor activeProcess suspend.
+                                                x1 := true].
+                                        x2 := true]
+                        ] ensure: [
+                                x3 := true].
+                        x4 := true. return value.
+                ] valueWithExit
+        ] newProcess.
+        p 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 | x4.
+        "now terminate the process and make sure all unwind blocks have finished"
+        [p terminate] forkAt: Processor activePriority + 1.
+        self assert: p isTerminated.
+        self assert: x1 & x2 & x3.
+        self deny: x4.!




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220614/a6349c8b/attachment-0001.html>


More information about the Squeak-dev mailing list