Race condition in common mapping implementation
https://gitlab.esrf.fr/bliss/bliss/-/jobs/327970
_________________________ test_reapplying_ctrl_params __________________________
default_session = <bliss.common.session.DefaultSession object at 0x7fa5d36dcbd0>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7fa5d300bbd0>
def test_reapplying_ctrl_params(default_session, caplog):
simulator = default_session.config.get("lima_simulator")
with lima_simulator_context("simulator", "id00/limaccds/simulator1"):
gevent.sleep(1.1) # wait until the DeviceProxy becomes usable again
with caplog.at_level(logging.DEBUG, logger="global.controllers.lima_simulator"):
loopscan(1, 0.1, simulator, save=False)
assert "All parameters will be refeshed on lima_simulator" in caplog.messages
with pytest.raises(DevFailed):
caplog.clear()
with caplog.at_level(logging.DEBUG, logger="global.controllers.lima_simulator"):
loopscan(1, 0.1, simulator, save=False)
with lima_simulator_context("simulator", "id00/limaccds/simulator1"):
gevent.sleep(1.1) # wait until the DeviceProxy becomes usable again
caplog.clear()
with caplog.at_level(logging.DEBUG, logger="global.controllers.lima_simulator"):
loopscan(1, 0.1, simulator, save=False)
assert "All parameters will be refeshed on lima_simulator" in caplog.messages
with lima_simulator_context("simulator", "id00/limaccds/simulator1"):
gevent.sleep(1.1) # wait until the DeviceProxy becomes usable again
caplog.clear()
> with caplog.at_level(logging.DEBUG, logger="global.controllers.lima_simulator"):
tests/controllers_sw/test_lima_simulator.py:1367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/conda/envs/testenv/lib/python3.7/contextlib.py:112: in __enter__
return next(self.gen)
/opt/conda/envs/testenv/lib/python3.7/site-packages/_pytest/logging.py:472: in at_level
logger_obj.setLevel(level)
/opt/conda/envs/testenv/lib/python3.7/site-packages/bliss/common/logtools.py:623: in setLevel
self.debugon()
/opt/conda/envs/testenv/lib/python3.7/site-packages/bliss/common/logtools.py:601: in debugon
for name, logger in Log._find_loggers(self.name + ".*").items():
/opt/conda/envs/testenv/lib/python3.7/site-packages/bliss/common/logtools.py:745: in _find_loggers
for node in global_map.walk_node("controllers"):
/opt/conda/envs/testenv/lib/python3.7/site-packages/bliss/common/mapping.py:305: in walk_node
self.create_submap(sub_map, map_id(from_node))
/opt/conda/envs/testenv/lib/python3.7/site-packages/bliss/common/mapping.py:444: in create_submap
self.create_submap(sub_G, n)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <bliss.common.alias.MapWithAliases object at 0x7fa630f01790>
sub_G = <networkx.classes.digraph.DiGraph object at 0x7fa5d1752610>
node = 140350196226192
def create_submap(self, sub_G, node):
"""
Create a submap starting from given node
Args:
sub_G: nx.DiGraph object that will be populated
node: instance or id(instance) of the starting node
Returns:
networkx.DiGraph
"""
id_ = map_id(node)
sub_G.add_node(id_, **self.G.nodes[id_]) # adds the node copying info
> for n in self.G.adj.get(id_):
E RuntimeError: dictionary changed size during iteration
/opt/conda/envs/testenv/lib/python3.7/site-packages/bliss/common/mapping.py:440: RuntimeError