Skip to content

Commit

Permalink
make e2e stable
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc committed Sep 20, 2024
1 parent d4e95af commit d26dad7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
26 changes: 10 additions & 16 deletions tests/e2e/tidbcluster/tidbcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,16 @@ var _ = ginkgo.Describe("TiDBCluster", func() {
utiltc.MustWaitForComponentPhase(cli, tc, v1alpha1.PDMemberType, v1alpha1.UpgradePhase, 3*time.Minute, time.Second*10)
log.Logf("PD is in UpgradePhase")

ginkgo.By("Wait for TiKV to be in UpgradePhase")
utiltc.MustWaitForComponentPhase(cli, tc, v1alpha1.TiKVMemberType, v1alpha1.UpgradePhase, 3*time.Minute, time.Second*10)
log.Logf("TiKV is in UpgradePhase")

ginkgo.By("Wait for TiDB to be in UpgradePhase")
utiltc.MustWaitForComponentPhase(cli, tc, v1alpha1.TiDBMemberType, v1alpha1.UpgradePhase, 3*time.Minute, time.Second*10)
log.Logf("TiDB is in UpgradePhase")

// the tc ready condition between components upgrade phase may not be observed
// and it may only observed the last ready after all components upgraded
ginkgo.By("Wait for tc ready")
err = oa.WaitForTidbClusterReady(tc, 10*time.Minute, 10*time.Second)
framework.ExpectNoError(err, "failed to wait for TidbCluster %s/%s components ready", ns, tc.Name)
Expand All @@ -2037,14 +2047,6 @@ var _ = ginkgo.Describe("TiDBCluster", func() {
log.Logf("PD config:\n%s", pdCm.Data["config-file"])
gomega.Expect(pdCm.Data["config-file"]).To(gomega.ContainSubstring("lease = 3"))

ginkgo.By("Wait for TiKV to be in UpgradePhase")
utiltc.MustWaitForComponentPhase(cli, tc, v1alpha1.TiKVMemberType, v1alpha1.UpgradePhase, 3*time.Minute, time.Second*10)
log.Logf("TiKV is in UpgradePhase")

ginkgo.By("Wait for tc ready")
err = oa.WaitForTidbClusterReady(tc, 10*time.Minute, 10*time.Second)
framework.ExpectNoError(err, "failed to wait for TidbCluster %s/%s components ready", ns, tc.Name)

ginkgo.By("Check TiKV configuration")
tikvMemberName := controller.TiKVMemberName(tc.Name)
tikvSts, err := stsGetter.StatefulSets(ns).Get(context.TODO(), tikvMemberName, metav1.GetOptions{})
Expand All @@ -2057,14 +2059,6 @@ var _ = ginkgo.Describe("TiDBCluster", func() {
log.Logf("TiKV config:\n%s", tikvCm.Data["config-file"])
gomega.Expect(tikvCm.Data["config-file"]).To(gomega.ContainSubstring("status-thread-pool-size = 1"))

ginkgo.By("Wait for TiDB to be in UpgradePhase")
utiltc.MustWaitForComponentPhase(cli, tc, v1alpha1.TiDBMemberType, v1alpha1.UpgradePhase, 3*time.Minute, time.Second*10)
log.Logf("TiDB is in UpgradePhase")

ginkgo.By("Wait for tc ready")
err = oa.WaitForTidbClusterReady(tc, 10*time.Minute, 10*time.Second)
framework.ExpectNoError(err, "failed to wait for TidbCluster %s/%s components ready", ns, tc.Name)

ginkgo.By("Check TiDB configuration")
tidbMemberName := controller.TiDBMemberName(tc.Name)
tidbSts, err := stsGetter.StatefulSets(ns).Get(context.TODO(), tidbMemberName, metav1.GetOptions{})
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/util/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var (
const (
// TiDB Version
TiDBLatestPrev = "v7.5.3"
TiDBLatest = "v8.1.1"
TiDBLatest = "v8.1.0" // different version with PDMSImage
TiDBNightlyVersion = "nightly"
// specific version
TiDBV7x5x0 = "v7.5.0"
Expand Down

0 comments on commit d26dad7

Please sign in to comment.