Skip to content

Introduce Spring property to disable context pausing for tests #36117

@sbrannen

Description

@sbrannen

Overview

Spring Framework 7.0 introduced support for pausing inactive application contexts between test classes and restarting them once they are needed again. If pausing and restarting are fast, this feature does not have a negative impact on test suites.

However, if the pausing or restarting of certain Lifecycle components in the application context is slow, that can have a negative impact on the duration of the overall test suite.

In #36044, we hope to find a way to avoid unnecessarily pausing an application context after a test class if the same context is used by the next test class that is run. That should help reduce the risk of a negative impact caused by the pause/restart feature; however, for certain scenarios that may not be enough. In light of that, this issue aims to introduce a mechanism for completely disabling the pausing feature — for example, via a Spring property.

spring.test.context.cache.pause=never

We are currently considering always (the default) and never as values, with the option to support on_context_switch (or similar) later for #36044.

Related Issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions