Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add downgrade cancellation e2e tests #19244

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

henrybear327
Copy link
Contributor

@henrybear327 henrybear327 commented Jan 21, 2025

Part 1 of the e2e test - downgrade cancellation is called before any of the node is actually downgraded

A README fix was also associated with this PR, as downgrade command doesn't seem to take version as a parameter.

Reference: #17976

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.87%. Comparing base (532c601) to head (82f30d1).

Additional details and impacted files

see 20 files with indirect coverage changes

@@           Coverage Diff           @@
##             main   #19244   +/-   ##
=======================================
  Coverage   68.87%   68.87%           
=======================================
  Files         420      420           
  Lines       35680    35680           
=======================================
  Hits        24573    24573           
- Misses       9685     9686    +1     
+ Partials     1422     1421    -1     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 532c601...82f30d1. Read the comment docs.

@henrybear327 henrybear327 self-assigned this Jan 21, 2025
etcdctl/README.md Show resolved Hide resolved
tests/e2e/cluster_downgrade_test.go Outdated Show resolved Hide resolved
@henrybear327 henrybear327 force-pushed the e2e/downgrade_cancellation_e2e branch from e1cbb11 to f1ff53e Compare January 21, 2025 21:06
@henrybear327 henrybear327 force-pushed the e2e/downgrade_cancellation_e2e branch 2 times, most recently from d5d064b to 4b25f0f Compare January 21, 2025 21:13
t.Logf("Starting downgrade process to %q", lastVersionStr)
e2e.DowngradeUpgradeMembers(t, nil, epc, len(epc.Procs), currentVersion, lastClusterVersion)
err = e2e.DowngradeUpgradeMembers(t, nil, epc, len(epc.Procs), currentVersion, lastClusterVersion)
Copy link
Contributor Author

@henrybear327 henrybear327 Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siyuanfoundation is there a reason that the return value of DowngradeUpgradeMembers is ignored? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed when merging the function with robustness test. Thanks for fixing it!

@henrybear327 henrybear327 force-pushed the e2e/downgrade_cancellation_e2e branch from bb4669c to b795e73 Compare January 21, 2025 21:43
@henrybear327 henrybear327 requested a review from ahrtr January 21, 2025 21:43
@henrybear327
Copy link
Contributor Author

/retest

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, henrybear327

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

if triggerCancellation == cancelRightBeforeEnable {
t.Logf("Cancelling downgrade before enabling")
e2e.DowngradeCancel(t, epc, generateIdenticalVersions(clusterSize, currentVersionStr))
return // No need to perform downgrading, end the test here
Copy link
Member

@serathius serathius Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test should have some validation, like check if cluster version of all members. For cancellation before and right after enable we the cluster version should stay the same. Also would be good to confirm the state of downgrade.

Copy link
Contributor Author

@henrybear327 henrybear327 Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am missing something.

The generateIdenticalVersions function generates the versions for the nodes that should be checked against already, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't noticed that e2e.DowngradeCancel is also doing validation. Any reason to combine it? I would recommend to either split it or make it clear from function name that you are validating.

Like

epc.Etcdutl().DowngradeCancel(context.TODO())
e2e.ValidateMemberVersions(epc, currentVersionStr)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like

epc.Etcdutl().DowngradeCancel(context.TODO())
e2e.ValidateMemberVersions(epc, currentVersionStr)

+1. It's OK to do it in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to add a util function of ValidateMemberVersions to verify versions based on the binary path of each process.

@ahrtr
Copy link
Member

ahrtr commented Jan 23, 2025

cc @siyuanfoundation @serathius

Comment on lines +66 to +70
ValidateVersion(t, epc.Cfg, epc.Procs[i], version.Versions{
Cluster: versions[i].Cluster,
Server: versions[i].Server,
Storage: versions[i].Storage,
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValidateVersion(t, epc.Cfg, epc.Procs[i], versions[i]) ?

if triggerCancellation == cancelRightBeforeEnable {
t.Logf("Cancelling downgrade before enabling")
e2e.DowngradeCancel(t, epc, generateIdenticalVersions(clusterSize, currentVersionStr))
return // No need to perform downgrading, end the test here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to add a util function of ValidateMemberVersions to verify versions based on the binary path of each process.

t.Logf("Starting downgrade process to %q", lastVersionStr)
e2e.DowngradeUpgradeMembers(t, nil, epc, len(epc.Procs), currentVersion, lastClusterVersion)
err = e2e.DowngradeUpgradeMembers(t, nil, epc, len(epc.Procs), currentVersion, lastClusterVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I missed when merging the function with robustness test. Thanks for fixing it!

@henrybear327 henrybear327 force-pushed the e2e/downgrade_cancellation_e2e branch from b795e73 to 2df6942 Compare January 24, 2025 19:04
@ahrtr
Copy link
Member

ahrtr commented Jan 26, 2025

pls fix the DCO failure.

henrybear327 and others added 2 commits January 26, 2025 16:16
@henrybear327 henrybear327 force-pushed the e2e/downgrade_cancellation_e2e branch from 2df6942 to 82f30d1 Compare January 26, 2025 15:16
@k8s-ci-robot
Copy link

@henrybear327: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-e2e-arm64 82f30d1 link true /test pull-etcd-e2e-arm64
pull-etcd-e2e-386 82f30d1 link true /test pull-etcd-e2e-386
pull-etcd-e2e-amd64 82f30d1 link true /test pull-etcd-e2e-amd64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@ahrtr
Copy link
Member

ahrtr commented Jan 27, 2025

Please rebase & squash the commits and resolve the DCO failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants