Pharo test defects

CavWindowStrategyTest

State
Fixed (image fix)
Defect in
the test
Tests
1
Fix
image fix 20-CavWindowStrategyTest.st
Upstream repository
pharo-spec/NewTools

Record

The test skipped itself with an unconditional self skip followed by self flag: #revisitAlexis. The code under test, CavExactOnTopStrategy>>placePresenter:, already sets position and extent from the placeholder. With the skip and the flag removed, the test passes unchanged on both VMs. The two sibling tests (PopUp and Cascading strategy) make the same assertions and already passed. The fix entry replaces only the test method and keeps both assertions and the trailing comment.

Test Defect in State Cause
CavWindowStrategyTest>>testExactReplaceStrategyDoesNotChangeExtentAndPosition test repaired Unconditional self skip and self flag: #revisitAlexis at the top of the test. The code under test works, so the skip was stale.

Regression check: I changed only a test method, so no non-test code needs separate coverage. I ran the whole CavWindowStrategyTest class (3 tests) 3 times on our VM (ours) and 3 times on Cog with the fix applied. Result: 3/3 PASS every run on both VMs. I also ran it once on ours-nojit: 3/3 PASS. Before the fix the class had 2 PASS and 1 SKIP; I did not re-measure that baseline in this session (the 2 PASS are the siblings, which pass in the with-fix runs).

Upstream note: Title: CavWindowStrategyTest: re-enable testExactReplaceStrategyDoesNotChangeExtentAndPosition. Project: Pharo (the test is in the pharo repository). The test called self skip with a #revisitAlexis flag. CavExactOnTopStrategy>>placePresenter: sets position and extent from the placeholder, so the test passes when the skip is removed. The PopUp and Cascading tests already make the same assertions. The change removes the two lines self skip. and self flag: #revisitAlexis.. I checked this on Pharo 14 build 791 with our VM and with Cog v12.0.6.

Results

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.

TestBeforeStateiospharo VMPatched CogStock Cog
CavWindowStrategyTest>>testExactReplaceStrategyDoesNotChangeExtentAndPositionSKIPrepairedPASSPASSPASS 3 of 3 (repair run)

Test

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)."
((CavWindowStrategyTest selector: #testExactReplaceStrategyDoesNotChangeExtentAndPosition) run) printString.

Source of the tests before the fix

CavWindowStrategyTest>>testExactReplaceStrategyDoesNotChangeExtentAndPosition before the fix (Pharo 14 build 791)
testExactReplaceStrategyDoesNotChangeExtentAndPosition

	| strategy |
	
	"In setUp
	placeHolder := (CavWindowPlaceHolder new position: 101@101; extent: 100@200).
	"
	self skip.
	self flag: #revisitAlexis.
	strategy := CavExactOnTopStrategy new.
	strategy placeHolder: placeHolder.
	strategy placePresenter: presenter.
	
	self assert: presenter extent equals: 100@200.
	self assert: presenter position equals: 101@101
	
	"we cannot test that if there was one window with the same presenter it got removed."

Fix

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.

20-CavWindowStrategyTest.st (download)
fix value: #CavWindowStrategyTest value: #testExactReplaceStrategyDoesNotChangeExtentAndPosition
	value: [ :source | source includesSubstring: 'self skip.' ]
	value:
'testExactReplaceStrategyDoesNotChangeExtentAndPosition

	| strategy |
	
	"In setUp
	placeHolder := (CavWindowPlaceHolder new position: 101@101; extent: 100@200).
	"
	strategy := CavExactOnTopStrategy new.
	strategy placeHolder: placeHolder.
	strategy placePresenter: presenter.
	
	self assert: presenter extent equals: 100@200.
	self assert: presenter position equals: 101@101
	
	"we cannot test that if there was one window with the same presenter it got removed."'.

State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.