Skip to content

Conversation

rwcarlsen
Copy link
Contributor

ops 1.5.2 introduced a fix to the harness' handling for departing unit tracking for events. This uncovered a subtle error in the tests here. remove_relation was triggering the "departing" relation data key to be inserted into the local charm's data because the local charm had been added to the relation units list (which is not really how that is intended to be used). This was causing the delete_user method to be called earlier than intended and caused assertion failures in the on_relation_broken test. The fix is to not add the local unit to the relation units. But then the relation departed test that checks for the "departing" data key wasn't working. So for now, we can add the local unit to the relation in that test only.

ops 1.5.2 introduced a fix to the harness' handling for departing unit
tracking for events.  This uncovered a subtle error in the tests here.
remove_relation was triggering the "departing" relation data key to be
inserted into the local charm's data because the local charm had been
added to the relation units list (which is not really how that is
intended to be used).  This was causing the delete_user method to be
called earlier than intended and caused assertion failures in the
on_relation_broken test.  The fix is to not add the local unit to the
relation units.  But then the relation departed test that checks for the
"departing" data key wasn't working.  So for now, we can add the local
unit to the relation in that test only.
@rwcarlsen
Copy link
Contributor Author

Integration failure. Seems unlikely to be caused by this (test code) change?

@marceloneppel
Copy link
Member

Integration failure. Seems unlikely to be caused by this (test code) change?

Yeah, them definitely are not related to the change. I will investigate further what is causing that. Thanks for the fix @rwcarlsen!

@marceloneppel marceloneppel merged commit 6adeb0d into canonical:main Sep 8, 2022
BON4 pushed a commit to BON4/postgresql-operator that referenced this pull request Apr 23, 2024
ops 1.5.2 introduced a fix to the harness' handling for departing unit
tracking for events.  This uncovered a subtle error in the tests here.
remove_relation was triggering the "departing" relation data key to be
inserted into the local charm's data because the local charm had been
added to the relation units list (which is not really how that is
intended to be used).  This was causing the delete_user method to be
called earlier than intended and caused assertion failures in the
on_relation_broken test.  The fix is to not add the local unit to the
relation units.  But then the relation departed test that checks for the
"departing" data key wasn't working.  So for now, we can add the local
unit to the relation in that test only.
github-actions bot added a commit to canonical/test-runners-2-github-x64-postgresql-operator that referenced this pull request May 19, 2024
github-actions bot added a commit to canonical/test-runners-2-is-x64-postgresql-operator that referenced this pull request May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants