Add ZeroMQ pytest fixtures to start the broker service inside pytest - #7464
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughChangesZeroMQ broker lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant pytest as pytest session
participant broker_fixture as broker service fixture
participant ZeromqBroker
participant subprocess as broker subprocess
pytest->>broker_fixture: request session broker service
broker_fixture->>ZeromqBroker: construct from profile
broker_fixture->>subprocess: start broker service
subprocess-->>broker_fixture: become reachable
broker_fixture-->>pytest: yield session control
pytest->>subprocess: send SIGINT
subprocess-->>pytest: shut down
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7464 +/- ##
==========================================
- Coverage 80.63% 80.63% -0.00%
==========================================
Files 580 581 +1
Lines 46754 46806 +52
==========================================
+ Hits 37697 37737 +40
- Misses 9057 9069 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4a7ee39 to
7a2dde3
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/aiida/tools/pytest_fixtures/broker.py`:
- Around line 1-3: Add the repository’s standard copyright header at the
beginning of the new broker fixture source file, before the module docstring.
Copy the exact header format and notice from an existing Python source file,
leaving the existing module contents unchanged.
- Around line 21-40: Update the aiida_broker_service docstring and usage example
to describe passing a Profile, matching run_service’s profile parameter and its
construction of ZeromqBroker(profile). Remove references to supplying an
existing ZeromqBroker while preserving the documented timeout and
context-manager behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6da108c4-0e14-44f8-b66f-343e46cba3cd
📒 Files selected for processing (7)
src/aiida/brokers/zeromq/broker.pysrc/aiida/tools/pytest_fixtures/__init__.pysrc/aiida/tools/pytest_fixtures/broker.pysrc/aiida/tools/pytest_fixtures/configuration.pytests/brokers/test_zeromq_broker.pytests/brokers/test_zeromq_communicator.pytests/conftest.py
7a2dde3 to
1d49231
Compare
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
34c2e8d to
b318e1f
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/tools/pytest_fixtures/test_configuration.py (1)
64-64: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueEscape the regex metacharacter in the
matchstring.The
matchparameter inpytest.raisesaccepts a regular expression. The.incore.unsupportedis a regex metacharacter and should be escaped to prevent unintended matches (e.g.,coreXunsupported).🛠️ Proposed fix
- with pytest.raises(ValueError, match='Unsupported broker backend: core.unsupported'): + with pytest.raises(ValueError, match=r'Unsupported broker backend: core\.unsupported'):🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/tools/pytest_fixtures/test_configuration.py` at line 64, Escape the dot in the pytest.raises match expression for the unsupported backend assertion so it matches the literal backend name rather than any character. Update only the match string in this test while preserving the existing ValueError expectation.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/aiida/tools/pytest_fixtures/__init__.py`:
- Line 6: The imported aiida_broker fixture is missing from the shared broker
module, while duplicate local implementations exist in both broker test files.
Add the session-scoped aiida_broker fixture to broker.py, keeping the existing
package import in src/aiida/tools/pytest_fixtures/__init__.py; remove the
duplicated fixture definitions from tests/brokers/test_zeromq_broker.py lines
25-36 and tests/brokers/test_zeromq_communicator.py lines 24-35.
In `@tests/brokers/test_zeromq_broker.py`:
- Around line 185-195: Extend test_get_communicator_and_close after the
cached-instance assertions to invoke the broker’s close behavior, preferably
through aiida_broker.close(), and assert the communicator is closed afterward.
Preserve the existing checks that get_communicator returns a cached, initially
open instance.
---
Nitpick comments:
In `@tests/tools/pytest_fixtures/test_configuration.py`:
- Line 64: Escape the dot in the pytest.raises match expression for the
unsupported backend assertion so it matches the literal backend name rather than
any character. Update only the match string in this test while preserving the
existing ValueError expectation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f6905a26-f087-4623-b086-8cae068d6589
📒 Files selected for processing (8)
src/aiida/brokers/zeromq/broker.pysrc/aiida/tools/pytest_fixtures/__init__.pysrc/aiida/tools/pytest_fixtures/broker.pysrc/aiida/tools/pytest_fixtures/configuration.pytests/brokers/test_zeromq_broker.pytests/brokers/test_zeromq_communicator.pytests/conftest.pytests/tools/pytest_fixtures/test_configuration.py
🚧 Files skipped from review as they are similar to previous changes (2)
- src/aiida/brokers/zeromq/broker.py
- tests/conftest.py
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
b318e1f to
37f3cd4
Compare
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
37f3cd4 to
0c4138b
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/tools/pytest_fixtures/test_configuration.py (1)
64-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueEscape regex metacharacters in
pytest.raisesmatch.The
matchargument inpytest.raisesis evaluated as a regular expression. The period.acts as a wildcard metacharacter. Using a raw string and escaping it will ensure an exact match and resolve the static analysis warning.♻️ Proposed refactor
- with pytest.raises(ValueError, match='Unsupported broker backend: core.unsupported'): + with pytest.raises(ValueError, match=r'Unsupported broker backend: core\.unsupported'):🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/tools/pytest_fixtures/test_configuration.py` at line 64, Update the pytest.raises assertion in the configuration test to use a raw regex string and escape the period in “core.unsupported,” ensuring the match is exact rather than treating the period as a wildcard.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/tools/pytest_fixtures/test_configuration.py`:
- Line 64: Update the pytest.raises assertion in the configuration test to use a
raw regex string and escape the period in “core.unsupported,” ensuring the match
is exact rather than treating the period as a wildcard.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 236de145-47c2-43e7-ae47-e2fab55662af
📒 Files selected for processing (8)
src/aiida/brokers/zeromq/broker.pysrc/aiida/tools/pytest_fixtures/__init__.pysrc/aiida/tools/pytest_fixtures/broker.pysrc/aiida/tools/pytest_fixtures/configuration.pytests/brokers/test_zeromq_broker.pytests/brokers/test_zeromq_communicator.pytests/conftest.pytests/tools/pytest_fixtures/test_configuration.py
🚧 Files skipped from review as they are similar to previous changes (6)
- src/aiida/tools/pytest_fixtures/init.py
- src/aiida/tools/pytest_fixtures/configuration.py
- src/aiida/brokers/zeromq/broker.py
- tests/brokers/test_zeromq_communicator.py
- tests/brokers/test_zeromq_broker.py
- tests/conftest.py
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
0c4138b to
62e9116
Compare
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
62e9116 to
f42ba4e
Compare
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
f42ba4e to
fcb2135
Compare
|
CI failure is due to flaky test |
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
The `ZeromqBroker` constructor previously raised a `ConfigurationError` whenever `supervised_by_daemon` was false, on the grounds that the location of the service state files would be unknown. That reasoning does not hold: the service directory and log file are derived from the profile configuration (`Config.filepaths`) and are therefore known regardless of who supervises the service lifecycle. The `supervised_by_daemon` flag only decides *who* starts and stops the service, not *where* it writes its files.
Add a test asserting that `aiida_profile_factory` raises for a broker backend that has no default configuration.
Add reusable pytest fixtures that run the ZeroMQ broker service for the session fixture `aiida_profile`, so the broker is available to runners without relying on the daemon to launch it: - `run_aiida_broker_service_for_profile`: returns a context manager that starts a ZeroMQ broker service subprocess for a given profile and stops it (and cleans up its service directory) on exit. - `run_aiida_broker_service`: autouse fixture that runs the service for the loaded `aiida_profile` for the whole session when its broker is ZeroMQ, and is a no-op for other backends (RabbitMQ, none) so it does not interfere with them. Remove the now-unused `_run_zeromq_broker_server` helper and the `zeromq_broker` fixture from `tests/conftest.py`. The session `aiida_profile` fixture no longer starts the broker service itself, as that is now handled by the autouse `run_aiida_broker_service` fixture. Update the ZeroMQ broker and communicator tests to obtain the broker from the session aiida profile instead of the temporary profile through the `zeromq_broker_with_server` fixture. The tests now do only run when the the session scoped aiida profile is used with the `core.zeromq` broker backend.
…ateam#7464) The `_patch_zmq_broker_service_filepaths` helper in `tests/conftest.py` had a single remaining caller: the `zeromq_broker` fixture in `tests/brokers/test_zeromq_broker.py`. Inline its logic into that fixture and remove the shared helper, along with the now-unused `patch` and `contextmanager` imports, from `conftest.py`.
Rename the test and its docstring to match what it actually covers.
The main motivation of these changes is to automatically start the ZMQ broker for plugin developers that use
aiida_profilewith the zeromq broker backend. For other profiles the fixturerun_broker_service_for_profilecan be used to start the broker for it. I tested the fixture on the aiida-quantumespresso nightly tests (see PR aiidateam/aiida-quantumespresso#1275)