charmed-kubernetes / pytest-operator

Apache License 2.0
6 stars 13 forks source link

Teardown reliability #73

Closed addyess closed 2 years ago

addyess commented 2 years ago

Attempting to address https://github.com/charmed-kubernetes/pytest-operator/issues/72

ca-scribner commented 2 years ago

I wonder why this has suddenly started popping up (I've talked to three people in the last week that hit this). If it is a teardown problem, it feels like the recent changes to pytest-operator shouldn't have made it worse, so maybe there's also been a recent change to juju that has caused the increased rate of problems?

ca-scribner commented 2 years ago

Nevermind ignore my previous comment - pinning to <0.17 fixes things so ...

addyess commented 2 years ago

the biggest change in this process is that the ops_test.plugin.forget_model now waits for a model to tear down rather than just issue the command to "Destroy the model" without the waiting. I think there's an exception being raised in the waiting for teardown code that isn't being caught which results in test errors in the clean up of ops_test

addyess commented 2 years ago

This other PR (https://github.com/charmed-kubernetes/kubernetes-metrics-server-operator/pull/1) is using this branch of pytest-operator to test the waters

addyess commented 2 years ago

@ca-scribner I've seen this seems to resolve the test teardown issues. Mind a review?

ca-scribner commented 2 years ago

Seems to be working in this test PR that was originally hitting the same issue