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

Cross-site fails with 3 or more sites #2152

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Conversation

pruivo
Copy link
Member

@pruivo pruivo commented Sep 25, 2024

Sort by site name when creating the configuration XML file to ensure a stable hashing

Closes #1834

Comment on lines 541 to 527
version := kube.GetStatefulSet(infinispan.Name, infinispan.Namespace).ObjectMeta.ResourceVersion

time.Sleep(10 * time.Second)

kube.WaitForInfinispanPods(3, tutils.SinglePodTimeout, infinispan.Name, namespace)
kube.WaitForInfinispanCondition(infinispan.Name, namespace, ispnv1.ConditionWellFormed)

otherVersion := kube.GetStatefulSet(infinispan.Name, infinispan.Namespace).ObjectMeta.ResourceVersion
assert.Equal(t, version, otherVersion)
Copy link
Member Author

Choose a reason for hiding this comment

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

@ryanemerson is there a better way to test it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should check the StatefulSet ObservedGeneration is 1 as the StatefulSet should never be modified once the initial cluster has been created. Take a look at spec_update_test for an idea of how to retrieve and check this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll try the generation... it is failing randomly locally 😢


defer kube.CleanNamespaceAndLogOnPanic(t, namespace)

infinispan := &ispnv1.Infinispan{
Copy link
Contributor

Choose a reason for hiding this comment

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

We can reduce the verbosity a fair bit here by using tutils.DefaultSpec(t, testKube, func(i *ispnv1.Infinispan) { to define the CR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had to set RUN_LOCAL_OPERATOR=false locally to make it work with that spec. Let's see if I need to update the GHA too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added to the GHA too. It was failing without it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's because with the DefaultSpec function and RUN_LOCAL_OPERATOR we're apply the webhook defaults. I'm surprised setting !RUN_LOCAL_OPERATOR works though, as that should prevent the Operator from being started so I wouldn't expect any reconciliation in the test 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Am I doing something wrong? The cross-site tests deploy the operator in the kind clusters:

make deploy IMG=$IMG DEPLOYMENT_NAMESPACE="${TESTING_NAMESPACE_XSITE}"

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, you're doing exactly the right thing ... I have just forgot that detail 😄

Comment on lines 541 to 527
version := kube.GetStatefulSet(infinispan.Name, infinispan.Namespace).ObjectMeta.ResourceVersion

time.Sleep(10 * time.Second)

kube.WaitForInfinispanPods(3, tutils.SinglePodTimeout, infinispan.Name, namespace)
kube.WaitForInfinispanCondition(infinispan.Name, namespace, ispnv1.ConditionWellFormed)

otherVersion := kube.GetStatefulSet(infinispan.Name, infinispan.Namespace).ObjectMeta.ResourceVersion
assert.Equal(t, version, otherVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should check the StatefulSet ObservedGeneration is 1 as the StatefulSet should never be modified once the initial cluster has been created. Take a look at spec_update_test for an idea of how to retrieve and check this.

@@ -467,6 +468,87 @@ func TestSuspectAndHearbeatConfig(t *testing.T) {
expectHeartBeatConfiguration(t, testKubes["xsite2"], true, hbInterval, hbTimeout)
}

func TestMultipleSites(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

As we're not actually waiting for the xsite view to form, maybe we should link the issue as a comment and update the name to TestMultipleSiteDefinitions

Sort by site name when creating the configuration XML file to ensure a
stable hashing

Closes infinispan#1834
@ryanemerson ryanemerson merged commit 5c18d7b into infinispan:main Sep 26, 2024
10 checks passed
@ryanemerson
Copy link
Contributor

Thanks @pruivo

@pruivo pruivo deleted the t_1834 branch September 26, 2024 11:56
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.

XSite fails with 3 or more sites on the same cluster
2 participants