Changed testing strategy used in 6b03179e.

Avoid polluting the app cache as it causes unrelated test failures.

Refs #19688.