From 9df19dedaf3c4f31382573c379cd0283599980ab Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 14 Jan 2026 16:58:03 +0100 Subject: [PATCH] Revise wording for PauseMode documentation See gh-36044 --- .../ctx-management/context-pausing.adoc | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management/context-pausing.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management/context-pausing.adoc index cd7fb8526f7..7b0c30b5574 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management/context-pausing.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management/context-pausing.adoc @@ -13,7 +13,7 @@ will be in a "stopped" state until the context is used again by a test. Note, ho that `SmartLifecycle` components can opt out of pausing by returning `false` from `SmartLifecycle#isPauseable()`. -You can control whether unused application contexts should be paused by setting the +You can control whether inactive application contexts should be paused by setting the `PauseMode` to one of the following supported values. `ALWAYS` :: Always pause inactive application contexts. @@ -28,19 +28,18 @@ line or a build script by setting a JVM system property named an alternative, you can set the property via the xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism. -For example, if you encounter issues with `Lifecycle` components that cannot or should -not opt out of pausing, or if you discover that your test suite runs more slowly due to -the pausing and restarting of application contexts, you can disable the pausing feature -by setting the `spring.test.context.cache.pause` property to `never`. +For example, if you want inactive application contexts to always be paused, you can +switch from the default `ON_CONTEXT_SWITCH` mode to `ALWAYS` by setting the +`spring.test.context.cache.pause` system property to `always`. ```shell --Dspring.test.context.cache.pause=never +-Dspring.test.context.cache.pause=always ``` - -Although `ON_CONTEXT_SWITCH` is the default pause mode, you still have the option to -enable context pausing for all usage scenarios (including context switches) by setting -the `spring.test.context.cache.pause` property to `always`. +Similarly, if you encounter issues with `Lifecycle` components that cannot or should not +opt out of pausing, or if you discover that your test suite runs more slowly due to the +pausing and restarting of application contexts, you can disable the pausing feature by +setting the `spring.test.context.cache.pause` system property to `never`. ```shell --Dspring.test.context.cache.pause=always +-Dspring.test.context.cache.pause=never ```