-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Killing the Discovery Service started by the Test Environment #346
Killing the Discovery Service started by the Test Environment #346
Conversation
ni_measurementlink_service/_internal/utilities/globaltestingstate.py
Outdated
Show resolved
Hide resolved
Please update the PR description to match the implementation since you're not using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MounikaBattu17 Did #344 not fix the ResourceWarning?
Yes, It fixed the resource warning. The ResourceWarning doesn't come if I run a measurement. |
If the resource warning was already fixed, why does the description of this PR talk about the resource warning? |
The resource warning which I'm referring is from the tests. Earlier/ without this PR changes, there was a resource warning after the test run.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests pass locally for me and don't get skipped when I have the DS installed.
This PR has got necessary approval. Hence merging. |
What does this Pull Request accomplish?
Acceptance tests (
test_measurement_service.py, test_streaming_data_measurement.py, test_yield_vs_return.py
) starts the discovery service for running their tests but doesn't terminate/kill it. This causes aResource Warning
while running all tests.Approach is to start the Discovery service independently and scope it to whole test session.
DiscoveryServiceProcess
intests/utilities/discovery_service_process.py
.__init__
is responsible for starting the discovery service and store the instance inself._proc
.__exit__
is responsible for killing the active Discovery service instance.discovery_service_process
that is responsible forproc
and scoped it tosession
for windows platform.discovery_service_process
fixture inmeasurement_service
fixture in each acceptance test files.Why should this Pull Request be merged?
What testing has been done?
poetry run pytest
, Observed there is noResource Warning
.