Skip to content

Test Solr on ephemeral host ports - never touches a site Solr - #85

Open
reekitconcept wants to merge 1 commit into
mainfrom
gh-83/solr-test-port-isolation
Open

Test Solr on ephemeral host ports - never touches a site Solr#85
reekitconcept wants to merge 1 commit into
mainfrom
gh-83/solr-test-port-isolation

Conversation

@reekitconcept

Copy link
Copy Markdown
Member

Fixes #83.

The test containers (solr-acceptance, tika-acceptance) bound the fixed host ports 8983/9998 — the same port a locally running site Solr uses — so the tests either clobbered its index (healed only by a full reindex) or could not start at all.

The compose mappings are now parameterized (${SOLR_ACCEPTANCE_PORT:-8983}:8983) and pytest sets them to 0, so every test session gets ephemeral host ports; manual/acceptance use keeps the fixed defaults. The Plone test fixture points collective.solr.port at the dynamic port (applied outside registry_config, so module-level overrides cannot lose it).

Verified: with a site Solr running on 8983 holding a marker document, the suite ran on an ephemeral port (55001) and the marker survived untouched — dev site and test suite can now run at the same time.

The test containers (solr-acceptance, tika-acceptance) previously
bound the fixed host ports 8983/9998 - the same port a locally
running site Solr uses, so tests either clobbered its index or could
not start. The compose mappings are now parameterized
(${SOLR_ACCEPTANCE_PORT:-8983}) and pytest sets them to 0, so every
test session gets ephemeral ports; manual/acceptance use keeps the
fixed defaults. The Plone test fixture points collective.solr.port at
the dynamic port (applied outside registry_config so overrides cannot
lose it). Verified: with a site Solr running on 8983, the suite runs
on an ephemeral port and the site index stays untouched.
@reekitconcept
reekitconcept force-pushed the gh-83/solr-test-port-isolation branch from 2391a03 to 03be844 Compare July 12, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Solr tests clobber a running dev site's Solr (shared host port)

1 participant