Skip to content

Commit

Permalink
Second attempt at timer fix, add release notes (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Jul 28, 2024
1 parent 1a99459 commit a31de7a
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 21 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/merge-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions docs/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Release Notes
.. toctree::
:maxdepth: 1

v2.1.1
v2.1.0
v2.0.1
v2.0.0
Expand Down
10 changes: 10 additions & 0 deletions docs/changelog/v2.1.1.rst
Original file line number Diff line number Diff line change
@@ -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`)
1 change: 1 addition & 0 deletions docs/fix_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
42 changes: 24 additions & 18 deletions pynetdicom/tests/test_assoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
UnifiedProcedureStepPush,
RepositoryQuery,
)
from pynetdicom.utils import set_timer_resolution

from .hide_modules import hide_modules

Expand Down Expand Up @@ -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

0 comments on commit a31de7a

Please sign in to comment.