From a31de7a16b6a7ca91e85dd44bb35327f5272544c Mon Sep 17 00:00:00 2001 From: scaramallion Date: Sun, 28 Jul 2024 10:34:39 +1000 Subject: [PATCH] Second attempt at timer fix, add release notes (#957) --- .github/workflows/merge-pytest.yml | 12 ++++++--- docs/changelog/index.rst | 1 + docs/changelog/v2.1.1.rst | 10 +++++++ docs/fix_search.py | 1 + pynetdicom/tests/test_assoc.py | 42 +++++++++++++++++------------- 5 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 docs/changelog/v2.1.1.rst diff --git a/.github/workflows/merge-pytest.yml b/.github/workflows/merge-pytest.yml index e9b273f917..f089ae49f6 100644 --- a/.github/workflows/merge-pytest.yml +++ b/.github/workflows/merge-pytest.yml @@ -72,8 +72,10 @@ jobs: poetry run pytest --cov pynetdicom --ignore=pynetdicom/apps && poetry run coverage xml - name: Send coverage results - if: ${{ success() }} + if: success() uses: codecov/codecov-action@v4 + env: + codecov_token: ${{ secrets.codecov_token }} pydicom-dev: # Matrix builds with development pydicom @@ -117,8 +119,10 @@ jobs: poetry run pytest --cov pynetdicom --ignore=pynetdicom/apps && poetry run coverage xml - name: Send coverage results - if: ${{ success() }} + if: success() uses: codecov/codecov-action@v4 + env: + codecov_token: ${{ secrets.codecov_token }} pydicom-release: # Matrix builds with released pydicom @@ -161,5 +165,7 @@ jobs: poetry run pytest --cov pynetdicom --ignore=pynetdicom/apps && poetry run coverage xml - name: Send coverage results - if: ${{ success() }} + if: success() uses: codecov/codecov-action@v4 + env: + codecov_token: ${{ secrets.codecov_token }} diff --git a/docs/changelog/index.rst b/docs/changelog/index.rst index 523d432900..3ab47361c6 100644 --- a/docs/changelog/index.rst +++ b/docs/changelog/index.rst @@ -7,6 +7,7 @@ Release Notes .. toctree:: :maxdepth: 1 + v2.1.1 v2.1.0 v2.0.1 v2.0.0 diff --git a/docs/changelog/v2.1.1.rst b/docs/changelog/v2.1.1.rst new file mode 100644 index 0000000000..61860c2d18 --- /dev/null +++ b/docs/changelog/v2.1.1.rst @@ -0,0 +1,10 @@ +.. _v2.1.1: + +2.1.1 +===== + +Fixes +..... + +* Fixed being unable to run the `movescp` app (:issue:`950`) +* Fixed search being broken in the documentation (:issue:`953`) diff --git a/docs/fix_search.py b/docs/fix_search.py index 3b3a6ba2eb..1c7d84e0b6 100644 --- a/docs/fix_search.py +++ b/docs/fix_search.py @@ -2,6 +2,7 @@ A temporary fix for #953 while waiting for upstream sphinx_rtd_theme to fix/remove their dependency on jQuery. """ + from pathlib import Path import re diff --git a/pynetdicom/tests/test_assoc.py b/pynetdicom/tests/test_assoc.py index 7c061fa5a6..c5aecace09 100644 --- a/pynetdicom/tests/test_assoc.py +++ b/pynetdicom/tests/test_assoc.py @@ -66,6 +66,7 @@ UnifiedProcedureStepPush, RepositoryQuery, ) +from pynetdicom.utils import set_timer_resolution from .hide_modules import hide_modules @@ -7570,27 +7571,32 @@ def test_no_ctypes(self): @pytest.mark.skipif(not HAVE_CTYPES, reason="No ctypes module") def test_set_timer_resolution(self): """Test setting the windows timer resolution works.""" - min_val, max_val, pre_timer = self.get_timer_info() - # Set the timer resolution to the minimum plus 10% - pynetdicom._config.WINDOWS_TIMER_RESOLUTION = min_val * 1.10 / 10000 + min_val, max_val, now = self.get_timer_info() + # Ensure we always start with the worst resolution + with set_timer_resolution(max_val / 10000): + min_val, max_val, pre_timer = self.get_timer_info() + # Set the timer resolution to the minimum plus 10% + pynetdicom._config.WINDOWS_TIMER_RESOLUTION = min_val * 1.10 / 10000 - self.ae = ae = AE() - ae.acse_timeout = 5 - ae.dimse_timeout = 5 - ae.network_timeout = 5 - ae.add_supported_context(Verification) - ae.add_requested_context(Verification) + self.ae = ae = AE() + ae.acse_timeout = 5 + ae.dimse_timeout = 5 + ae.network_timeout = 5 + ae.add_supported_context(Verification) + ae.add_requested_context(Verification) - scp = ae.start_server(("localhost", 11112), block=False) + scp = ae.start_server(("localhost", 11112), block=False) - assoc = ae.associate("localhost", 11112) + assoc = ae.associate("localhost", 11112) - min_val, max_val, during_timer = self.get_timer_info() - assert during_timer < pre_timer - assoc.release() - assert assoc.is_released + min_val, max_val, during_timer = self.get_timer_info() + assert during_timer < pre_timer + assoc.release() + assert assoc.is_released - scp.shutdown() + scp.shutdown() + + time.sleep(1) - min_val, max_val, post_timer = self.get_timer_info() - assert post_timer > during_timer + min_val, max_val, post_timer = self.get_timer_info() + assert post_timer > during_timer