[bug] iterate over values of a WeakValueDictionary
https://gitlab.esrf.fr/bliss/bliss/-/jobs/132745
#bliss/config/channels.py
class Bus:
def close(self):
for channel in self._channels.values():
channel.close()
____ ERROR at teardown of test_session_does_not_contain_default_plugin_objs ____
ports = Ports(redis_port=42218, tango_port=35493, beacon_port=57242, cfgapp_port=39608)
@pytest.fixture
def beacon(ports):
redis_db = redis.Redis(port=ports.redis_port)
redis_db.flushall()
static.Config.instance = None
client._default_connection = connection.Connection("localhost", ports.beacon_port)
config = static.get_config()
yield config
settings_cache.close_all_client_cache()
> config.close()
tests/conftest.py:224:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bliss/config/static.py:637: in close
channels.Bus.clear_cache()
bliss/config/channels.py:131: in clear_cache
bus.close()
bliss/config/channels.py:121: in close
for channel in self._channels.values():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <WeakValueDictionary at 0x7f9a9651af90>
def values(self):
if self._pending_removals:
self._commit_removals()
with _IterationGuard(self):
> for wr in self.data.values():
E RuntimeError: dictionary changed size during iteration
/opt/conda/envs/testenv/lib/python3.7/weakref.py:248: RuntimeError