Skip to content

Commit

Permalink
[DPE-4739] Avoid using time.sleep in rollback integration tests (#298)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
shayancanonical committed Aug 14, 2024
1 parent cd85a84 commit 82c7a0e
Show file tree
Hide file tree
Showing 9 changed files with 1,294 additions and 367 deletions.
11 changes: 7 additions & 4 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ bases:
channel: "22.04"
architectures: [arm64]
parts:
files:
plugin: dump
source: .
prime:
- charm_version
- workload_version
- scripts
charm:
override-pull: |
craftctl default
Expand All @@ -20,10 +27,6 @@ parts:
fi
charm-strict-dependencies: true
charm-entrypoint: src/kubernetes_charm.py
prime:
- charm_version
- workload_version
- scripts
build-packages:
- libffi-dev
- libssl-dev
Expand Down
Loading

0 comments on commit 82c7a0e

Please sign in to comment.