scripts/image-fixes/20-WeakAnnouncerTest.stAnnouncementSubscription>>makeWeak, WeakAnnouncerTest>>testNoWeakBlocktestNoWeakBlock was an expected failure. AnnouncementSubscription>>makeWeak raised 'Not currently available due to missing ephemerons support' for block actions. The test comment states the intended behaviour: there is no weak block, a block subscription never goes away. The fix makes makeWeak return self (stay strong) when the action is a block, and removes the <expectedFailure> pragma from the test. The test body is unchanged. The same defect is in image code, not in either VM. No other code or test in pharo/src depends on the old error.
| Test | Defect in | State | Cause |
|---|---|---|---|
WeakAnnouncerTest>>testNoWeakBlock |
image-code | repaired | AnnouncementSubscription>>makeWeak raised an error for block actions instead of keeping the subscription strong, and the test was marked expectedFailure to record that. |
Regression check: Measured with runtest.sh, PASS counts before the fix and after the fix, on both ours and cog. WeakAnnouncerTest: 33 before, 34 after, on both VMs. AnnouncerTest: 29 before, 29 after, on both VMs. SubscriptionRegistryTest does not exist (0 and 0). AnnouncementSetTest was not run. makeWeak is called only from WeakAnnouncerTest in the pharo sources.
Upstream note: Title: Announcements: makeWeak on a block subscription stays strong instead of raising an error. Description: AnnouncementSubscription>>makeWeak raised an error for block actions because of missing ephemerons, and WeakAnnouncerTest>>testNoWeakBlock was marked <expectedFailure> although its comment says "there is no such thing as a weak block, these things never go away". makeWeak now returns self for a block action, and the expectedFailure mark is removed. Project: pharo (Announcements-Core, Announcements-Core-Tests). This note is a draft; the owner must review it before any PR is made.
Last full sweeps of 2026-11-17: iospharo (sweep14-new14) and stock Cog with the Cog changes (sweepcogp14-new10), with all image fixes. "Before" is the state of the test before the repairs. The Stock Cog column has a value only where the record measured stock Cog: "PASS 3 of 3 (repair run)" is the check of each repair on stock Cog v12.0.6 with the fix entry; "-" is not measured separately.
| Test | Before | State | iospharo VM | Patched Cog | Stock Cog |
|---|---|---|---|---|---|
WeakAnnouncerTest>>testNoWeakBlock | XFAIL | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
Run the tests in a Pharo 14 image (build 791). Before the fix they skip, fail or carry the expected-failure mark.
"Run in a Playground of a Pharo 14 image (Do it and print each line)." ((WeakAnnouncerTest selector: #testNoWeakBlock) run) printString.
testNoWeakBlock "There is no such thing as a weak block, these things never go away." <expectedFailure> | counter | self longTestCase. counter := 0. (announcer when: AnnouncementMockA do: [ :ann | counter := counter + 1 ] for: self) makeWeak. Smalltalk garbageCollect. announcer announce: AnnouncementMockA. self assert: counter equals: 1. Smalltalk garbageCollect. announcer announce: AnnouncementMockA. self assert: counter equals: 2
How to apply an entries file: file in 00-header.st and the entries file as one chunk (the iospharo script scripts/gen-image-fixes.py makes that chunk). Each entry checks for the defect first and prints FIXED, ADDED or SKIP. Download 00-header.st.
"A block action holds its receiver strongly and there are no ephemerons, so a block subscription cannot be weak. makeWeak keeps the subscription strong instead of raising an error, as testNoWeakBlock states." fix value: #AnnouncementSubscription value: #makeWeak value: [ :s | s includesSubstring: 'missing ephemerons support' ] value: 'makeWeak "A block holds its receiver strongly and there are no ephemerons, so there is no weak block subscription: stay strong." action isBlock ifTrue: [ ^ self ]. ^ announcer replace: self with: (WeakAnnouncementSubscription new announcer: announcer; action: action asWeakMessageSend; subscriber: subscriber; announcementClass: announcementClass)'. fix value: #WeakAnnouncerTest value: #testNoWeakBlock value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testNoWeakBlock "There is no such thing as a weak block, these things never go away." | counter | self longTestCase. counter := 0. (announcer when: AnnouncementMockA do: [ :ann | counter := counter + 1 ] for: self) makeWeak. Smalltalk garbageCollect. announcer announce: AnnouncementMockA. self assert: counter equals: 1. Smalltalk garbageCollect. announcer announce: AnnouncementMockA. self assert: counter equals: 2'.
State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.