Skip to content

Solr test suite: runtime regression since the unittest to pytest migration #81

Description

@reebalazs

The Solr-based test suite became much slower after the migration to pytest fixtures. Two verified causes:

  1. 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.
  2. 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions