The Solr-based test suite became much slower after the migration to pytest fixtures. Two verified causes:
- The Plone test layer stack was rebuilt for every test class. zope.pytestlayer only preserves layers across classes for zope.testrunner style tests; for pytest style tests its class-scoped layer fixture tears the whole layer stack down after each class, so the Plone site (incl. profiles) was set up many times per run.
- Per-testcase setup repeated per assertion. With parametrized tests, a single Solr query followed by N assertions runs as N separate tests — each repeating the full setup (registry, index clear, content creation, commit/reindex) and the same query, just to make one assertion. Content and query should be set up once per test class and shared by all its checks.
Acceptance criterion: total runtime of the Solr-based test suite, before vs. after; content creation and the Solr query must not repeat per assertion (verifiable with --setup-show).
Result: tests/services went from 7:27 to 0:53 (~8.5x); a parametrized class with N assertions now creates its content and runs its query exactly once.
(The test-vs-dev Solr port collision was split into its own ticket.)
The Solr-based test suite became much slower after the migration to pytest fixtures. Two verified causes:
Acceptance criterion: total runtime of the Solr-based test suite, before vs. after; content creation and the Solr query must not repeat per assertion (verifiable with
--setup-show).Result:
tests/serviceswent from 7:27 to 0:53 (~8.5x); a parametrized class with N assertions now creates its content and runs its query exactly once.(The test-vs-dev Solr port collision was split into its own ticket.)