Skip to content

Commit 4722b97

Browse files
committed
Remove @isolated annotations and update misleading parallel test comments
- Removed @isolated from CommandObjectsSpec and CommandObjectNoDataSpec as it only affects Spock's internal parallelism, not Gradle fork-based test isolation - Updated comments across 29 files to clarify that fixes address test isolation (shared static state between tests in the same fork), not parallel execution - Clarified that tests run sequentially within each fork but static state persists
1 parent ba00568 commit 4722b97

File tree

29 files changed

+52
-56
lines changed

29 files changed

+52
-56
lines changed

grails-data-mongodb/core/src/test/groovy/org/grails/datastore/gorm/mongo/connections/MongoConnectionSourcesSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class MongoConnectionSourcesSpec extends AutoStartedMongoSpec {
6060
}
6161

6262
void setup() {
63-
// Ensure tenant property is cleared before each test for isolation with parallel test execution
63+
// Ensure tenant property is cleared before each test for test isolation
6464
System.clearProperty(SystemPropertyTenantResolver.PROPERTY_NAME)
6565
}
6666

grails-data-mongodb/core/src/test/groovy/org/grails/datastore/gorm/mongo/connections/MultiTenancySpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class MultiTenancySpec extends AutoStartedMongoSpec {
5858
}
5959

6060
void setup() {
61-
// Ensure tenant property is cleared before each test for isolation with parallel test execution
61+
// Ensure tenant property is cleared before each test for test isolation
6262
System.clearProperty(SystemPropertyTenantResolver.PROPERTY_NAME)
6363
}
6464

grails-data-mongodb/core/src/test/groovy/org/grails/datastore/gorm/mongo/connections/SchemaBasedMultiTenancySpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SchemaBasedMultiTenancySpec extends AutoStartedMongoSpec {
5252
}
5353

5454
void setup() {
55-
// Ensure tenant property is cleared before each test for isolation with parallel test execution
55+
// Ensure tenant property is cleared before each test for test isolation
5656
System.clearProperty(SystemPropertyTenantResolver.PROPERTY_NAME)
5757
}
5858

grails-data-mongodb/core/src/test/groovy/org/grails/datastore/gorm/mongo/connections/SingleTenancySpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class SingleTenancySpec extends AutoStartedMongoSpec {
6767
}
6868

6969
void setup() {
70-
// Ensure tenant property is cleared before each test for isolation with parallel test execution
70+
// Ensure tenant property is cleared before each test for test isolation
7171
System.clearProperty(SystemPropertyTenantResolver.PROPERTY_NAME)
7272
}
7373

grails-data-mongodb/core/src/test/groovy/org/grails/datastore/gorm/mongo/multitenancy/MongoStaticApiMultiTenancySpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class MongoStaticApiMultiTenancySpec extends AutoStartedMongoSpec {
5252
}
5353

5454
void setup() {
55-
// Ensure tenant property is cleared before each test for isolation with parallel test execution
55+
// Ensure tenant property is cleared before each test for test isolation
5656
System.clearProperty(SystemPropertyTenantResolver.PROPERTY_NAME)
5757
}
5858

grails-domain-class/src/test/groovy/grails/persistence/DomainClassTraitSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DomainClassTraitSpec extends Specification {
3939

4040
void cleanupSpec() {
4141
// Use cleanupSpec() instead of cleanup() to clear Holders only after all tests
42-
// in this class complete, avoiding interference with parallel tests in other classes
42+
// in this class complete, ensuring proper test isolation
4343
Holders.clear()
4444
}
4545

grails-gsp/plugin/src/test/groovy/org/grails/web/mapping/RestfulReverseUrlRenderingTests.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ import spock.lang.Specification
3131
class RestfulReverseUrlRenderingTests extends Specification implements UrlMappingsUnitTest<RestfulReverseUrlMappings> {
3232

3333
def setup() {
34-
// Clear any existing URL mappings artefacts to prevent pollution from parallel test execution
34+
// Clear any existing URL mappings artefacts to ensure test isolation
3535
clearUrlMappingsArtefacts()
3636
}
3737

3838
def cleanup() {
39-
// Clear URL mappings artefacts added by this test to prevent pollution of other tests
39+
// Clear URL mappings artefacts added by this test to ensure test isolation
4040
clearUrlMappingsArtefacts()
4141
}
4242

grails-gsp/plugin/src/test/groovy/org/grails/web/taglib/AbstractGrailsTagTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ abstract class AbstractGrailsTagTests {
376376

377377
onDestroy()
378378

379-
// Clear URL mappings artefacts to prevent pollution of parallel tests
379+
// Clear URL mappings artefacts to ensure test isolation
380380
if (ga instanceof DefaultGrailsApplication) {
381381
((DefaultGrailsApplication) ga).@artefactInfo.remove(UrlMappingsArtefactHandler.TYPE)
382382
}

grails-gsp/plugin/src/test/groovy/org/grails/web/taglib/FormTagLibTests.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class FormTagLibTests extends Specification implements TagLibUnitTest<FormTagLib
5252
def setup() {
5353
tagLib.requestDataValueProcessor = new MockRequestDataValueProcessor()
5454

55-
// Clear any existing URL mappings artefacts to prevent pollution from parallel test execution
55+
// Clear any existing URL mappings artefacts to ensure test isolation
5656
clearUrlMappingsArtefacts()
5757
grailsApplication.addArtefact(UrlMappingsArtefactHandler.TYPE, FormTagLibUrlMappings)
5858

grails-mimetypes/src/main/groovy/org/grails/web/mime/HttpServletRequestExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class HttpServletRequestExtension {
7676
static MimeType[] getMimeTypes(HttpServletRequest request) {
7777
MimeType[] result = (MimeType[]) request.getAttribute(GrailsApplicationAttributes.REQUEST_FORMATS)
7878
if (!result) {
79-
// First try to get context from GrailsWebRequest (more reliable in tests with parallel execution)
79+
// First try to get context from GrailsWebRequest (more reliable for test isolation)
8080
// This avoids issues where the servlet context attributes may be polluted by other tests
8181
ApplicationContext context = null
8282
GrailsWebRequest webRequest = GrailsWebRequest.lookup()

0 commit comments

Comments
 (0)