-
Notifications
You must be signed in to change notification settings - Fork 54
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
Conversation
test/e2e/xsite/xsite_test.go
Outdated
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) |
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.
@ryanemerson is there a better way to test it?
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.
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.
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.
I'll try the generation... it is failing randomly locally 😢
test/e2e/xsite/xsite_test.go
Outdated
|
||
defer kube.CleanNamespaceAndLogOnPanic(t, namespace) | ||
|
||
infinispan := &ispnv1.Infinispan{ |
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 can reduce the verbosity a fair bit here by using tutils.DefaultSpec(t, testKube, func(i *ispnv1.Infinispan) {
to define the CR.
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.
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.
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.
Added to the GHA too. It was failing without it.
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.
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 🤔
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.
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}" |
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.
Nope, you're doing exactly the right thing ... I have just forgot that detail 😄
test/e2e/xsite/xsite_test.go
Outdated
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) |
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.
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.
test/e2e/xsite/xsite_test.go
Outdated
@@ -467,6 +468,87 @@ func TestSuspectAndHearbeatConfig(t *testing.T) { | |||
expectHeartBeatConfiguration(t, testKubes["xsite2"], true, hbInterval, hbTimeout) | |||
} | |||
|
|||
func TestMultipleSites(t *testing.T) { |
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 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
Thanks @pruivo |
Sort by site name when creating the configuration XML file to ensure a stable hashing
Closes #1834