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

unit tests for hostnetwork and run e2e test conditionally #1093

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

cofyc
Copy link
Contributor

@cofyc cofyc commented Nov 1, 2019

What problem does this PR solve?

fixes #1042

What is changed and how does it work?

Check List

Tests

  • Unit test
  • E2E test
  • Stability test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has Helm charts change
  • Has Go code change
  • Has CI related scripts change
  • Has documents change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Does this PR introduce a user-facing change?:


@cofyc
Copy link
Contributor Author

cofyc commented Nov 1, 2019

/run-e2e-test

@@ -426,7 +426,7 @@ func (pmm *pdMemberManager) pdStatefulSetIsUpgrading(set *apps.StatefulSet, tc *
return false, nil
}

func (pmm *pdMemberManager) getNewPDSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) {
func getNewPDSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

function receiver is removed because not needed

@@ -219,7 +219,7 @@ func getNewTiDBHeadlessServiceForTidbCluster(tc *v1alpha1.TidbCluster) *corev1.S
}
}

func (tmm *tidbMemberManager) getNewTiDBSetForTidbCluster(tc *v1alpha1.TidbCluster) *apps.StatefulSet {
func getNewTiDBSetForTidbCluster(tc *v1alpha1.TidbCluster) *apps.StatefulSet {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

function receiver is removed because not needed

@@ -269,7 +269,7 @@ func getNewServiceForTidbCluster(tc *v1alpha1.TidbCluster, svcConfig SvcConfig)
return &svc
}

func (tkmm *tikvMemberManager) getNewSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) {
func getNewTiKVSetForTidbCluster(tc *v1alpha1.TidbCluster) (*apps.StatefulSet, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

function receiver is removed because not needed, easier to test

@cofyc
Copy link
Contributor Author

cofyc commented Nov 1, 2019

/run-e2e-test

(sv.AtLeast(utilversion.MustParseSemantic("v1.15.0")) && sv.LessThan(utilversion.MustParseSemantic("v1.15.4"))) { // >= v1.15.0 but < v1.15.4
// https://github.com/pingcap/tidb-operator/issues/1042#issuecomment-547742565
glog.Infof("Skipping HostNetwork test. Kubernetes %v has a bug that StatefulSet may apply revision incorrectly, HostNetwork cannot work well in this cluster", serverVersion)
return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

example log:

[2019-11-01T03:35:11.775Z] I1101 03:35:09.611526       1 main.go:181] ServerVersion: v1.12.10

[2019-11-01T03:35:11.775Z] I1101 03:35:09.611549       1 main.go:186] Skipping HostNetwork test. Kubernetes v1.12.10 has a bug that StatefulSet may apply revision incorrectly, HostNetwork cannot work well in this cluster

@cofyc cofyc requested review from Yisaer, weekface, tennix, onlymellb and DanielZhangQD and removed request for Yisaer November 1, 2019 04:04
Copy link
Contributor

@aylei aylei left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -172,6 +173,20 @@ func main() {
* Note that only one cluster can run in host network mode at the same time.
*/
testHostNetwork := func(wg *sync.WaitGroup, cluster *tests.TidbClusterConfig) {
serverVersion, err := kubeCli.Discovery().ServerVersion()
if err != nil {
panic(err)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

exit if the cluster is unavailable or unstable

Copy link
Contributor

@weekface weekface left a comment

Choose a reason for hiding this comment

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

LGTM

@cofyc cofyc merged commit 4661874 into pingcap:master Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

more tests for host network feature
3 participants