-
Notifications
You must be signed in to change notification settings - Fork 57
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
AV-218868: Fix common failing unit tests #1541
base: master
Are you sure you want to change the base?
Conversation
No JIRA Ids found for the PR. Jira id is mandatory to update fix version in jira. Please update respective Jira id in PR title or commit message if the PR is intented for default branches of repo. For mandatory exemptions, comment trigger phrase 'skip jira-id-check' in PR. For manual trigger, comment trigger phrase 'run jira-id-check' in PR. |
build ako |
build ako |
build ako |
Common tests failing fixed till now: TestFQDNsCountForAviInfraSettingWithLargeShardSize |
build ako |
1 similar comment
build ako |
@@ -51,7 +54,7 @@ func UpdateHostRuleStatus(key string, hr *akov1beta1.HostRule, updateStatus Upda | |||
"status": akov1beta1.HostRuleStatus(updateStatus), | |||
}) | |||
|
|||
_, err := lib.AKOControlConfig().V1beta1CRDClientset().AkoV1beta1().HostRules(hr.Namespace).Patch(context.TODO(), hr.Name, types.MergePatchType, patchPayload, metav1.PatchOptions{}, "status") | |||
hrFromK8sClient, err := lib.AKOControlConfig().V1beta1CRDClientset().AkoV1beta1().HostRules(hr.Namespace).Patch(context.TODO(), hr.Name, types.MergePatchType, patchPayload, metav1.PatchOptions{}, "status") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial comment: why are we retrying here as we are fetching from directly clientset so we should have updated content?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are doing a patch through clientset which returns the updated result but we are not sure if the crd informer is also updated with the changes. So here, we are waiting for the informer to be updated with the patch
build ako |
8 similar comments
build ako |
build ako |
build ako |
build ako |
build ako |
build ako |
build ako |
build ako |
No JIRA Ids found for the PR. Jira id is mandatory to update fix version in jira. Please update respective Jira id in PR title or commit message if the PR is intented for default branches of repo. For mandatory exemptions, comment trigger phrase 'skip jira-id-check' in PR. For manual trigger, comment trigger phrase 'run jira-id-check' in PR. |
build ako |
build ako |
|
||
.PHONY: multi_tenancy | ||
multi_tenancy: | ||
make -j 1 multitenancytests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we removing this target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant to multitenancytests target
tests/integrationtest/lib.go
Outdated
g := gomega.NewGomegaWithT(t) | ||
g.Eventually(func() error { | ||
ingClass, err := utils.GetInformers().IngressClassInformer.Lister().Get(ingclassName) | ||
utils.AviLog.Infof("got ingclass %v", ingClass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this log should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
build ako |
@@ -64,6 +67,25 @@ func UpdateHostRuleStatus(key string, hr *akov1beta1.HostRule, updateStatus Upda | |||
} | |||
UpdateHostRuleStatus(key, updatedHr, updateStatus, retry+1) | |||
} | |||
// wait for crdinformer to be updated | |||
constantBackoff := backoff.WithMaxRetries(backoff.NewConstantBackOff(500*time.Millisecond), 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is being used in main processing path. It will impact each and every status update. Can it be optimized or moved to some other place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will only be impacted if it fails for the first time. We will wait for 500ms only when it is not updated. Best case is 0 ms. Worst case is 2.5s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being done to make sure that informer cache is populated before AKO uses hostrule in graph layer, did we see any issue related to this and if that's the case why aren't we doing the same for other CRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, we will take for other CRs separately
build ako |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Need to re-run multiple times to verify its working fine.
build ako |
build ako |
1 similar comment
build ako |
err = backoff.Retry(operation, constantBackoff) | ||
if err != nil { | ||
utils.AviLog.Errorf("key: %s, msg: Hostrule %s/%s lister cache not updated with patch. error: [%s]", key, hr.Namespace, hr.Name, err.Error()) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a return or the success message gets printed as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
informer cache is internal for us, the kubernetes object has already been patched so successful message is also necessary
@@ -485,7 +485,7 @@ func TestFQDNsCountForAviInfraSettingWithDedicatedShardSize(t *testing.T) { | |||
g.Eventually(func() bool { | |||
_, found := mcache.VsCacheMeta.AviCacheGet(vsKey) | |||
return found | |||
}, 50*time.Second).Should(gomega.Equal(false)) | |||
}, 50*time.Second, 5*time.Second).Should(gomega.Equal(false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we increasing the polling period from 10 ms to 5 seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to decrease the load on cpu
build ako |
No description provided.