Skip to content

Commit

Permalink
Merge pull request #3120 from chrischdi/pr-runtime-sdk-flake-resource…
Browse files Browse the repository at this point in the history
…-version

🌱 test: dump resources before ValidateResourceVersionStable test
  • Loading branch information
k8s-ci-robot authored Jul 29, 2024
2 parents e2627e2 + e4120f6 commit 4fee909
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/e2e/cluster_upgrade_runtimesdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package e2e

import (
"path/filepath"

"github.com/blang/semver/v4"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand All @@ -42,6 +44,12 @@ var _ = Describe("When upgrading a workload cluster using ClusterClass with Runt
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
PostUpgrade: func(proxy framework.ClusterProxy, namespace, clusterName string) {
// Dump all Cluster API related resources to artifacts before checking for resource versions being stable.
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
Lister: proxy.GetClient(),
Namespace: namespace,
LogPath: filepath.Join(artifactFolder, "clusters-beforeValidateResourceVersions", proxy.GetName(), "resources")})

// This check ensures that the resourceVersions are stable, i.e. it verifies there are no
// continuous reconciles when everything should be stable.
framework.ValidateResourceVersionStable(ctx, proxy, namespace, FilterObjectsWithKindAndName(clusterName))
Expand Down
7 changes: 7 additions & 0 deletions test/e2e/ownerrefs_finalizers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"os"
"path/filepath"
"time"

. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -149,6 +150,12 @@ var _ = Describe("Ensure OwnerReferences and Finalizers are resilient [vcsim] [s
return nil
}, 5*time.Minute, 15*time.Second).Should(Succeed(), "Waiting for nodes to be ready")

// Dump all Cluster API related resources to artifacts before checking for resource versions being stable.
framework.DumpAllResources(ctx, framework.DumpAllResourcesInput{
Lister: proxy.GetClient(),
Namespace: namespace,
LogPath: filepath.Join(artifactFolder, "clusters-beforeValidateResourceVersions", proxy.GetName(), "resources")})

// This check ensures that the resourceVersions are stable, i.e. it verifies there are no
// continuous reconciles when everything should be stable.
// Note: we are not checking resourceVersions on VirtualMachine (reconciled by VM-Operator)
Expand Down

0 comments on commit 4fee909

Please sign in to comment.