Pharo test defects

Cly-wrapper-queries

State
Fixed (image fix)
Defect in
the test
Tests
14
Fix
image fix 20-Cly-wrapper-queries.st
Upstream repository
pharo-project/pharo

Record

All 14 tests are inherited from ClyWrapQueryTest, which inherits composite-query tests from ClyCompositeQueryTest. Those inherited tests build a query with two subqueries. ClyWrapperQuery>>subqueries: refuses that by design ('Wrapper query should include single subquery'), so ClyWrapQueryTest marked 7 selectors expectedFailure and called super. The failure was therefore the intended behaviour, not a defect in either VM. The fix overrides the 7 selectors in ClyWrapQueryTest with the real contract and removes the marks. The 6 multi-subquery tests keep their original setup and assert that the wrapper refuses it with the 'single subquery' error and keeps its subqueries unchanged. testHasCompositeScopeFromSubqueries asserts that the wrapper scope is not a ClyCompositeScope and equals the scope of its single subquery. No VM difference was found: both VMs give identical results.

Test Defect in State Cause
ClyAsyncQueryTest>>testHasCompositeScopeFromSubqueries test repaired Inherited composite expectation does not apply to a single-subquery wrapper; the test was marked expectedFailure instead of testing the wrapper contract
ClyAsyncQueryTest>>testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects test repaired Two-subquery setup is refused by ClyWrapperQuery>>subqueries:; the test now asserts the refusal
ClyAsyncQueryTest>>testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject test repaired same
ClyAsyncQueryTest>>testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope test repaired same
ClyAsyncQueryTest>>testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject test repaired same
ClyAsyncQueryTest>>testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope test repaired same
ClyAsyncQueryTest>>testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects test repaired same
ClyFilterQueryTest>>testHasCompositeScopeFromSubqueries test repaired same as the Async variant (inherited from ClyWrapQueryTest)
ClyFilterQueryTest>>testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects test repaired same
ClyFilterQueryTest>>testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject test repaired same
ClyFilterQueryTest>>testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope test repaired same
ClyFilterQueryTest>>testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject test repaired same
ClyFilterQueryTest>>testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope test repaired same
ClyFilterQueryTest>>testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects test repaired same

Regression check: Only test methods were changed, so no non-test code needs a covering class. Run on both VMs, same class, base image vs fixed image: ClyAsyncQueryTest passes went 33 to 40 on ours and 33 to 40 on Cog. ClyFilterQueryTest went 34 to 41 on both. ClyUnionQueryTest (a sibling subclass of ClyCompositeQueryTest) stayed at 52 on both. ClyCompositeQueryTest and ClyQueryTest are abstract and ran 0 tests. The two repaired classes each ran 3 times on both VMs with the same result, and no non-PASS lines were seen apart from the DONE marker.

Upstream note: Pharo, package Calypso-NavigationModel-Tests: ClyWrapQueryTest overrides 7 composite-query tests as expectedFailure and calls super, so they always fail by design (ClyWrapperQuery>>subqueries: accepts exactly one subquery). Replace the marks with tests of the real contract: the wrapper refuses several subqueries with an error naming 'single subquery', and its scope equals the scope of its single subquery. Not opened as an upstream PR; the owner reviews any PR first.

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
ClyAsyncQueryTest>>testHasCompositeScopeFromSubqueriesXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyAsyncQueryTest>>testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjectsXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyAsyncQueryTest>>testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObjectXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyAsyncQueryTest>>testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScopeXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyAsyncQueryTest>>testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObjectXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyAsyncQueryTest>>testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScopeXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyAsyncQueryTest>>testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjectsXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testHasCompositeScopeFromSubqueriesXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjectsXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObjectXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScopeXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObjectXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScopeXFAILrepairedPASSPASSPASS 3 of 3 (repair run)
ClyFilterQueryTest>>testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjectsXFAILrepairedPASSPASSPASS 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)."
((ClyAsyncQueryTest selector: #testHasCompositeScopeFromSubqueries) run) printString.
((ClyAsyncQueryTest selector: #testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects) run) printString.
((ClyAsyncQueryTest selector: #testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject) run) printString.
((ClyAsyncQueryTest selector: #testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope) run) printString.
((ClyAsyncQueryTest selector: #testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject) run) printString.
((ClyAsyncQueryTest selector: #testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope) run) printString.
((ClyAsyncQueryTest selector: #testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects) run) printString.
((ClyFilterQueryTest selector: #testHasCompositeScopeFromSubqueries) run) printString.
((ClyFilterQueryTest selector: #testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects) run) printString.
((ClyFilterQueryTest selector: #testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject) run) printString.
((ClyFilterQueryTest selector: #testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope) run) printString.
((ClyFilterQueryTest selector: #testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject) run) printString.
((ClyFilterQueryTest selector: #testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope) run) printString.
((ClyFilterQueryTest selector: #testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects) run) printString.

Source of the tests before the fix

ClyWrapQueryTest>>testHasCompositeScopeFromSubqueries before the fix (Pharo 14 build 791)
testHasCompositeScopeFromSubqueries
	<expectedFailure>
	"Async query must be created on single subquery.
	And in that case scope will be same as scope of this subquery"
	super testHasCompositeScopeFromSubqueries
ClyWrapQueryTest>>testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects before the fix (Pharo 14 build 791)
testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects
	<expectedFailure>
	"Async query forbid creation on several subqueries.
	It shoud always wrap single query"
	super testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects
ClyWrapQueryTest>>testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject before the fix (Pharo 14 build 791)
testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject
	<expectedFailure>
	"Async query forbid creation on several subqueries.
	It shoud always wrap single query"
	super testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject
ClyWrapQueryTest>>testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope before the fix (Pharo 14 build 791)
testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope
	<expectedFailure>
	"Async query forbid creation on several subqueries.
	It shoud always wrap single query"
	super testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope
ClyWrapQueryTest>>testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject before the fix (Pharo 14 build 791)
testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject
	<expectedFailure>
	"Async query forbid creation on several subqueries.
	It shoud always wrap single query"
	super testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject
ClyWrapQueryTest>>testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope before the fix (Pharo 14 build 791)
testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope
	<expectedFailure>
	"Async query forbid creation on several subqueries.
	It shoud always wrap single query"
	super testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope
ClyWrapQueryTest>>testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects before the fix (Pharo 14 build 791)
testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects
	<expectedFailure>
	"Async query forbid creation on several subqueries.
	It shoud always wrap single query"
	super testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects

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-Cly-wrapper-queries.st (download)
fix value: #ClyWrapQueryTest value: #testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testIsExecutedFromMultipleScopeWhenSubqueriesAreFromScopesOfDifferentObjects
	"A wrapper query wraps exactly one subquery (ClyWrapperQuery>>subqueries:), so the
	multi-subquery setup of the inherited composite test must be refused."
	| subqueriesBefore |
	subqueriesBefore := query subqueries.
	self
		should: [ query subqueries: {
		self subqueryFromScopeOf: self class.
		self subqueryFromScopeOf: self class superclass.
	} ]
		raise: Error
		whoseDescriptionIncludes: ''single subquery''
		description: ''A wrapper query must refuse several subqueries''.
	self assert: query subqueries equals: subqueriesBefore'.
fix value: #ClyWrapQueryTest value: #testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testIsExecutedFromSingleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject
	"A wrapper query wraps exactly one subquery (ClyWrapperQuery>>subqueries:), so the
	multi-subquery setup of the inherited composite test must be refused."
	| subqueriesBefore |
	subqueriesBefore := query subqueries.
	self
		should: [ query subqueries: {
		self subqueryFromScope: ClyExampleScope of: self class.
		self subqueryFromScope: ClyExample2Scope of: self class.
	} ]
		raise: Error
		whoseDescriptionIncludes: ''single subquery''
		description: ''A wrapper query must refuse several subqueries''.
	self assert: query subqueries equals: subqueriesBefore'.
fix value: #ClyWrapQueryTest value: #testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testNotExecutedFromMultipleScopeWhenAllSubqueriesAreFromEmptyScope
	"A wrapper query wraps exactly one subquery (ClyWrapperQuery>>subqueries:), so the
	multi-subquery setup of the inherited composite test must be refused."
	| subqueriesBefore |
	subqueriesBefore := query subqueries.
	self
		should: [ query subqueries: {
		self subqueryFromScope: ClyExampleScope empty.
		self subqueryFromScope: ClyExample2Scope empty.
	} ]
		raise: Error
		whoseDescriptionIncludes: ''single subquery''
		description: ''A wrapper query must refuse several subqueries''.
	self assert: query subqueries equals: subqueriesBefore'.
fix value: #ClyWrapQueryTest value: #testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testNotExecutedFromMultipleScopeWhenSubqueriesAreFromDifferentScopesOfSameObject
	"A wrapper query wraps exactly one subquery (ClyWrapperQuery>>subqueries:), so the
	multi-subquery setup of the inherited composite test must be refused."
	| subqueriesBefore |
	subqueriesBefore := query subqueries.
	self
		should: [ query subqueries: {
		self subqueryFromScope: ClyExampleScope of: self class.
		self subqueryFromScope: ClyExample2Scope of: self class.
	} ]
		raise: Error
		whoseDescriptionIncludes: ''single subquery''
		description: ''A wrapper query must refuse several subqueries''.
	self assert: query subqueries equals: subqueriesBefore'.
fix value: #ClyWrapQueryTest value: #testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testNotExecutedFromSingleScopeWhenAllSubqueriesAreFromEmptyScope
	"A wrapper query wraps exactly one subquery (ClyWrapperQuery>>subqueries:), so the
	multi-subquery setup of the inherited composite test must be refused."
	| subqueriesBefore |
	subqueriesBefore := query subqueries.
	self
		should: [ query subqueries: {
		self subqueryFromScope: ClyExampleScope empty.
		self subqueryFromScope: ClyExample2Scope empty.
	} ]
		raise: Error
		whoseDescriptionIncludes: ''single subquery''
		description: ''A wrapper query must refuse several subqueries''.
	self assert: query subqueries equals: subqueriesBefore'.
fix value: #ClyWrapQueryTest value: #testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testNotExecutedFromSingleScopeWhenSubqueriesAreFromScopesOfDifferentObjects
	"A wrapper query wraps exactly one subquery (ClyWrapperQuery>>subqueries:), so the
	multi-subquery setup of the inherited composite test must be refused."
	| subqueriesBefore |
	subqueriesBefore := query subqueries.
	self
		should: [ query subqueries: {
		self subqueryFromScopeOf: self class.
		self subqueryFromScopeOf: self class superclass.
	} ]
		raise: Error
		whoseDescriptionIncludes: ''single subquery''
		description: ''A wrapper query must refuse several subqueries''.
	self assert: query subqueries equals: subqueriesBefore'.
fix value: #ClyWrapQueryTest value: #testHasCompositeScopeFromSubqueries value: [ :s | s includesSubstring: '<expectedFailure>' ] value: 'testHasCompositeScopeFromSubqueries
	"A wrapper query wraps exactly one subquery, so its scope is the scope of that subquery,
	not a ClyCompositeScope (ClyWrapperQuery>>subqueries: refuses several subqueries)."
	| scope subscope |
	scope := query scope.
	subscope := query subqueries anyOne scope.
	self deny: scope class equals: ClyCompositeScope.
	self assert: scope equals: subscope'.

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