Skip to content

fix(tests): correct the location of the Harness cleanup#1719

Draft
marceloneppel wants to merge 1 commit into
mainfrom
fix/test-db-stray-harness-cleanup
Draft

fix(tests): correct the location of the Harness cleanup#1719
marceloneppel wants to merge 1 commit into
mainfrom
fix/test-db-stray-harness-cleanup

Conversation

@marceloneppel
Copy link
Copy Markdown
Member

Issue

Solution

test_get_extensions called cleanup() on the Harness before using it, so begin() and the assertion ran against an already-cleaned harness. This only worked because of a Harness bug that leaves a dangling sqlite3 reference; the fix for that bug (canonical/operator#2507) makes cleanup() tear down properly and breaks the test. Call cleanup() once the harness is finished with instead.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Port of canonical/postgresql-k8s-operator#1551.

test_get_extensions called cleanup() on the Harness before using it, so
begin() and the assertion ran against an already-cleaned harness. This
only worked because of a Harness bug that leaves a dangling sqlite3
reference; the fix for that bug (canonical/operator#2507) makes cleanup()
tear down properly and breaks the test. Call cleanup() once the harness
is finished with instead.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel added the bug Something isn't working as expected label May 28, 2026
@github-actions github-actions Bot added the Libraries: Out of sync The charm libs used are out-of-sync label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant