dev: zmq hwm rebind (#1480)

* move hwm into the zmq constructor and reconstruct the socket instead of rebind. seems to work better than rebind (most connections cant bind so fast?)

* fix after merge

* added tests to reconnect zmq sockets when setting rx zmqport and rx zmqhwm, changed the tests scripts a bit to make the receiver starting tcp port configurable

* tests: slsreceiver also starting up  with 2000 as default tcp port, using latest cli args for receiver and multi receiver

* releasr notes

---------

Co-authored-by: AliceMazzoleni99 <alice.mazzoleni@psi.ch>
This commit is contained in:
2026-08-03 09:34:57 +02:00
committed by mazzol_a
co-authored by mazzol_a
parent 3a780271c6
commit 9c0bfe3517
13 changed files with 231 additions and 121 deletions
+51
View File
@@ -0,0 +1,51 @@
import pytest
import sys
import time
from conftest import session_simulator
from slsdet import Detector
from slsdet.utils import element_if_equal
from slsdet._slsdet import slsDetectorDefs
from utils_for_test import (
Log,
LogLevel,
)
detectorType = slsDetectorDefs.detectorType
@pytest.mark.detectorintegration
@pytest.mark.parametrize(
"session_simulator",
[
("eiger", 1, 20)
],
indirect=True,
)
def test_zmq_reconnect(session_simulator, request):
""" Test changing zmq ports and zmq hwm with zmq sockets connected (reconnect). """
det_type, num_interfaces, num_mods, d = session_simulator
assert d is not None
assert d.type == detectorType.EIGER
d.rx_zmqstream = True
assert d.rx_zmqstream == True
port = 14000
hwm = 2
for _ in range(10):
d.rx_zmqport = port
d.rx_zmqhwm = hwm
Log(LogLevel.INFOGREEN, f"Set zmqport={port}, zmqhwm={hwm}")
port += 1000
hwm += 5
time.sleep(1)
Log(LogLevel.INFOGREEN, f"{request.node.name} passed")