Merge pull request #2819 from jwcesign/failing-test-fix
e2e: wait till the informer's cache is synced in karmada-controller
This commit is contained in:
commit
594ad9f44b
|
@ -331,8 +331,6 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
var deploymentNamespace, deploymentName string
|
var deploymentNamespace, deploymentName string
|
||||||
var deployment *appsv1.Deployment
|
var deployment *appsv1.Deployment
|
||||||
var policyHigherPriorityLabelSelector, policyLowerPriorityMatchName, policyImplicitPriorityMatchName *policyv1alpha1.ClusterPropagationPolicy
|
var policyHigherPriorityLabelSelector, policyLowerPriorityMatchName, policyImplicitPriorityMatchName *policyv1alpha1.ClusterPropagationPolicy
|
||||||
var priorityLabelKey = "priority"
|
|
||||||
var priorityLabelValue = "priority"
|
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
higherPriorityLabelSelector = deploymentNamePrefix + "higherprioritylabelselector" + rand.String(RandomStrLength)
|
higherPriorityLabelSelector = deploymentNamePrefix + "higherprioritylabelselector" + rand.String(RandomStrLength)
|
||||||
|
@ -340,6 +338,8 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
implicitPriorityMatchName = deploymentNamePrefix + "implicitprioritymatchname" + rand.String(RandomStrLength)
|
implicitPriorityMatchName = deploymentNamePrefix + "implicitprioritymatchname" + rand.String(RandomStrLength)
|
||||||
deploymentNamespace = testNamespace
|
deploymentNamespace = testNamespace
|
||||||
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
||||||
|
var priorityLabelKey = "priority"
|
||||||
|
var priorityLabelValue = "priority" + rand.String(RandomStrLength)
|
||||||
|
|
||||||
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
||||||
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
||||||
|
@ -383,8 +383,9 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
framework.CreateClusterPropagationPolicy(karmadaClient, policyLowerPriorityMatchName)
|
framework.CreateClusterPropagationPolicy(karmadaClient, policyLowerPriorityMatchName)
|
||||||
framework.CreateClusterPropagationPolicy(karmadaClient, policyImplicitPriorityMatchName)
|
framework.CreateClusterPropagationPolicy(karmadaClient, policyImplicitPriorityMatchName)
|
||||||
|
|
||||||
// Wait policy present in cache
|
// Wait till the informer's cache is synced in karmada-controller.
|
||||||
time.Sleep(time.Second)
|
// Note: We tested and find that it takes about 1s before cache synced.
|
||||||
|
time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
framework.CreateDeployment(kubeClient, deployment)
|
framework.CreateDeployment(kubeClient, deployment)
|
||||||
ginkgo.DeferCleanup(func() {
|
ginkgo.DeferCleanup(func() {
|
||||||
|
@ -413,14 +414,14 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
var deploymentNamespace, deploymentName string
|
var deploymentNamespace, deploymentName string
|
||||||
var deployment *appsv1.Deployment
|
var deployment *appsv1.Deployment
|
||||||
var policyExplicitPriorityLabelSelector, policyExplicitPriorityMatchName *policyv1alpha1.ClusterPropagationPolicy
|
var policyExplicitPriorityLabelSelector, policyExplicitPriorityMatchName *policyv1alpha1.ClusterPropagationPolicy
|
||||||
var priorityLabelKey = "priority"
|
|
||||||
var priorityLabelValue = "priority"
|
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
explicitPriorityLabelSelector = deploymentNamePrefix + "explicitprioritylabelselector" + rand.String(RandomStrLength)
|
explicitPriorityLabelSelector = deploymentNamePrefix + "explicitprioritylabelselector" + rand.String(RandomStrLength)
|
||||||
explicitPriorityMatchName = deploymentNamePrefix + "explicitprioritymatchname" + rand.String(RandomStrLength)
|
explicitPriorityMatchName = deploymentNamePrefix + "explicitprioritymatchname" + rand.String(RandomStrLength)
|
||||||
deploymentNamespace = testNamespace
|
deploymentNamespace = testNamespace
|
||||||
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
||||||
|
var priorityLabelKey = "priority"
|
||||||
|
var priorityLabelValue = "priority" + rand.String(RandomStrLength)
|
||||||
|
|
||||||
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
||||||
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
||||||
|
@ -452,8 +453,9 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
framework.CreateClusterPropagationPolicy(karmadaClient, policyExplicitPriorityLabelSelector)
|
framework.CreateClusterPropagationPolicy(karmadaClient, policyExplicitPriorityLabelSelector)
|
||||||
framework.CreateClusterPropagationPolicy(karmadaClient, policyExplicitPriorityMatchName)
|
framework.CreateClusterPropagationPolicy(karmadaClient, policyExplicitPriorityMatchName)
|
||||||
|
|
||||||
// Wait policy present in cache
|
// Wait till the informer's cache is synced in karmada-controller.
|
||||||
time.Sleep(time.Second)
|
// Note: We tested and find that it takes about 1s before cache synced.
|
||||||
|
time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
framework.CreateDeployment(kubeClient, deployment)
|
framework.CreateDeployment(kubeClient, deployment)
|
||||||
ginkgo.DeferCleanup(func() {
|
ginkgo.DeferCleanup(func() {
|
||||||
|
|
|
@ -700,8 +700,6 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
var deploymentNamespace, deploymentName string
|
var deploymentNamespace, deploymentName string
|
||||||
var deployment *appsv1.Deployment
|
var deployment *appsv1.Deployment
|
||||||
var policyHigherPriorityLabelSelector, policyLowerPriorityMatchMatchName, policyImplicitPriorityMatchMatchName *policyv1alpha1.PropagationPolicy
|
var policyHigherPriorityLabelSelector, policyLowerPriorityMatchMatchName, policyImplicitPriorityMatchMatchName *policyv1alpha1.PropagationPolicy
|
||||||
var priorityLabelKey = "priority"
|
|
||||||
var priorityLabelValue = "priority"
|
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
policyNamespace = testNamespace
|
policyNamespace = testNamespace
|
||||||
|
@ -710,6 +708,8 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
implicitPriorityMatchName = deploymentNamePrefix + "implicitprioritymatchname" + rand.String(RandomStrLength)
|
implicitPriorityMatchName = deploymentNamePrefix + "implicitprioritymatchname" + rand.String(RandomStrLength)
|
||||||
deploymentNamespace = testNamespace
|
deploymentNamespace = testNamespace
|
||||||
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
||||||
|
var priorityLabelKey = "priority"
|
||||||
|
var priorityLabelValue = "priority" + rand.String(RandomStrLength)
|
||||||
|
|
||||||
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
||||||
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
||||||
|
@ -753,8 +753,9 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
framework.CreatePropagationPolicy(karmadaClient, policyLowerPriorityMatchMatchName)
|
framework.CreatePropagationPolicy(karmadaClient, policyLowerPriorityMatchMatchName)
|
||||||
framework.CreatePropagationPolicy(karmadaClient, policyImplicitPriorityMatchMatchName)
|
framework.CreatePropagationPolicy(karmadaClient, policyImplicitPriorityMatchMatchName)
|
||||||
|
|
||||||
// Wait policy present in cache
|
// Wait till the informer's cache is synced in karmada-controller.
|
||||||
time.Sleep(time.Second)
|
// Note: We tested and find that it takes about 1s before cache synced.
|
||||||
|
time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
framework.CreateDeployment(kubeClient, deployment)
|
framework.CreateDeployment(kubeClient, deployment)
|
||||||
ginkgo.DeferCleanup(func() {
|
ginkgo.DeferCleanup(func() {
|
||||||
|
@ -784,8 +785,6 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
var deploymentNamespace, deploymentName string
|
var deploymentNamespace, deploymentName string
|
||||||
var deployment *appsv1.Deployment
|
var deployment *appsv1.Deployment
|
||||||
var policyExplicitPriorityLabelSelector, policyExplicitPriorityMatchName *policyv1alpha1.PropagationPolicy
|
var policyExplicitPriorityLabelSelector, policyExplicitPriorityMatchName *policyv1alpha1.PropagationPolicy
|
||||||
var priorityLabelKey = "priority"
|
|
||||||
var priorityLabelValue = "priority"
|
|
||||||
|
|
||||||
ginkgo.BeforeEach(func() {
|
ginkgo.BeforeEach(func() {
|
||||||
policyNamespace = testNamespace
|
policyNamespace = testNamespace
|
||||||
|
@ -793,6 +792,8 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
explicitPriorityMatchName = deploymentNamePrefix + "explicitprioritymatchname" + rand.String(RandomStrLength)
|
explicitPriorityMatchName = deploymentNamePrefix + "explicitprioritymatchname" + rand.String(RandomStrLength)
|
||||||
deploymentNamespace = testNamespace
|
deploymentNamespace = testNamespace
|
||||||
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
deploymentName = deploymentNamePrefix + rand.String(RandomStrLength)
|
||||||
|
var priorityLabelKey = "priority"
|
||||||
|
var priorityLabelValue = "priority" + rand.String(RandomStrLength)
|
||||||
|
|
||||||
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
deployment = testhelper.NewDeployment(deploymentNamespace, deploymentName)
|
||||||
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
deployment.SetLabels(map[string]string{priorityLabelKey: priorityLabelValue})
|
||||||
|
@ -824,8 +825,9 @@ var _ = ginkgo.Describe("[ExplicitPriority] propagation testing", func() {
|
||||||
framework.CreatePropagationPolicy(karmadaClient, policyExplicitPriorityLabelSelector)
|
framework.CreatePropagationPolicy(karmadaClient, policyExplicitPriorityLabelSelector)
|
||||||
framework.CreatePropagationPolicy(karmadaClient, policyExplicitPriorityMatchName)
|
framework.CreatePropagationPolicy(karmadaClient, policyExplicitPriorityMatchName)
|
||||||
|
|
||||||
// Wait policy present in cache
|
// Wait till the informer's cache is synced in karmada-controller.
|
||||||
time.Sleep(time.Second)
|
// Note: We tested and find that it takes about 1s before cache synced.
|
||||||
|
time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
framework.CreateDeployment(kubeClient, deployment)
|
framework.CreateDeployment(kubeClient, deployment)
|
||||||
ginkgo.DeferCleanup(func() {
|
ginkgo.DeferCleanup(func() {
|
||||||
|
|
Loading…
Reference in New Issue