Skip to content

fix: cloud entries in an dictionary were being deleted while iterating the object#155

Merged
addyess merged 1 commit into
mainfrom
fix/deleting-multiple-clouds
Oct 4, 2025
Merged

fix: cloud entries in an dictionary were being deleted while iterating the object#155
addyess merged 1 commit into
mainfrom
fix/deleting-multiple-clouds

Conversation

@addyess

@addyess addyess commented Oct 3, 2025

Copy link
Copy Markdown

Found in a PR where multiple kubernetes clouds were created by pytest_operator atop an existing machine cloud.

When cleaning up the created clouds, we deleted an entry in self.forget_cloud(...) that was maintained by self._clouds

this results in an exception:

  File "/home/ubuntu/actions-runner/_work/k8s-operator/k8s-operator/.tox/integration/lib/python3.12/site-packages/pytest_operator/plugin.py", line 1092, in _cleanup_models
    for cloud in reversed(self._clouds):
RuntimeError: OrderedDict mutated during iteration

The correct behavior is to operate on an inline list instead of iterating the dict itself.

@addyess addyess merged commit 7a450fe into main Oct 4, 2025
14 checks passed
@addyess addyess deleted the fix/deleting-multiple-clouds branch October 4, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants