Skip to content

Commit 82c7a0e

Browse files
[DPE-4739] Avoid using time.sleep in rollback integration tests (#298)
## Issue 1. We use time.sleep instead of a deterministic way to determine when to send `resume-upgrade` after rolling back. This sometimes leads to [this error](https://github.com/canonical/mysql-router-k8s-operator/actions/runs/10312040824/job/28546894902#step:31:2522) when `resume-upgrade` is run too early ``` Resume upgrade event failed: Highest number unit is unhealthy. Upgrade will not resume. ``` 2. We are using `prime` in charmcraft which is deprecated in charmcraft 3.1.1 ## Solution 1. Use a more deterministic approach - check that all units are `active` and `idle` (one will have rolled back while the other two will not) 2. Use parts to prime version files and the dump plugin to prime scripts/ directory
1 parent cd85a84 commit 82c7a0e

File tree

9 files changed

+1294
-367
lines changed

9 files changed

+1294
-367
lines changed

charmcraft.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ bases:
1010
channel: "22.04"
1111
architectures: [arm64]
1212
parts:
13+
files:
14+
plugin: dump
15+
source: .
16+
prime:
17+
- charm_version
18+
- workload_version
19+
- scripts
1320
charm:
1421
override-pull: |
1522
craftctl default
@@ -20,10 +27,6 @@ parts:
2027
fi
2128
charm-strict-dependencies: true
2229
charm-entrypoint: src/kubernetes_charm.py
23-
prime:
24-
- charm_version
25-
- workload_version
26-
- scripts
2730
build-packages:
2831
- libffi-dev
2932
- libssl-dev

0 commit comments

Comments
 (0)