radondb / radondb-mysql-kubernetes

Open Source,High Availability Cluster,based on MySQL
Apache License 2.0
356 stars 84 forks source link

[BUG] e2e failed #348

Open andyli029 opened 2 years ago

andyli029 commented 2 years ago

Describe the problem

$ make e2e-local
=== RUN   TestE2E
STEP: Creating framework with timeout: 1200
Running Suite: MySQL Operator E2E Suite
=======================================
Random Seed: 1640748419 - Will randomize all specs
Will run 1 of 1 specs

STEP: Install operator
Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "mysql-operator-metrics-reader" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "yeshqc": current value is "demo"
Failure [0.972 seconds]
[BeforeSuite] BeforeSuite
/root/go/src/github.com/radondb/radondb-mysql-kubernetes/test/e2e/e2e.go:49

  Expected success, but got an error:
      <*exec.ExitError | 0xc0003a8000>: {
....
  /root/go/src/github.com/radondb/radondb-mysql-kubernetes/test/e2e/framework/helm.go:40
------------------------------
STEP: Remove operator release
Error: uninstall: Release not loaded: yeshqc: release: not found

Failure [0.000 seconds]
[AfterSuite] AfterSuite
/root/go/src/github.com/radondb/radondb-mysql-kubernetes/test/e2e/e2e.go:83

  Expected success, but got an error:
      <*exec.ExitError | 0xc000568040>: {
....
  /root/go/src/github.com/radondb/radondb-mysql-kubernetes/test/e2e/framework/helm.go:53
------------------------------

Ran 1 of 0 Specs in 1.043 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 0 Skipped

To Reproduce

1.

Expected behavior

Environment:

andyli029 commented 2 years ago

Fix the case:

$ helm ls --all --all-namespaces | grep mysql-operator

NAME                            NAMESPACE                       REVISION    UPDATED                                 STATUS          CHART                       APP VERSION
demo                            mysql-operator                  1           2021-12-28 03:24:11.657721954 +0000 UTC uninstalling    mysql-operator-0.1.1        latest
$ helm delete demo -n mysql-operator
$ make e2e-local
Ran 1 of 1 Specs in 21.534 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
andyli029 commented 2 years ago

Link: https://github.com/radondb/radondb-mysql-kubernetes/pull/302

runkecheng commented 2 years ago

If the framework is allowed to automatically delete existing resources, the original resources may not be able to run after the test runs.

acekingke commented 2 years ago

I have suggest the release name should be random.