Skip to content

Commit

Permalink
Initial test assertions for service cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gerlowskija committed Dec 11, 2024
1 parent 1570ece commit 7d48a1d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/e2e/solrcloud_scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ var _ = FDescribe("E2E - SolrCloud - Scale Down", func() {
})

FContext("with replica migration", func() {
BeforeEach(func() {
solrCloud.Spec.SolrAddressability = solrv1beta1.SolrAddressabilityOptions{
External: &solrv1beta1.ExternalAddressability{
Method: solrv1beta1.Ingress,
UseExternalAddress: true,
HideNodes: false,
DomainName: "test.solr.org",
},
}
})

FIt("Scales Down", func(ctx context.Context) {
originalSolrCloud := solrCloud.DeepCopy()
solrCloud.Spec.Replicas = pointer.Int32(1)
Expand Down Expand Up @@ -134,6 +145,11 @@ var _ = FDescribe("E2E - SolrCloud - Scale Down", func() {
g.Expect(clusterOp).To(BeNil(), "StatefulSet should not have a ScaleDown lock after scaling is complete.")
})

// Once the scale-down occurs, services for the now-defunct pods should begone
Eventually(Expect(k8sClient.Get(ctx, resourceKey(solrCloud, solrCloud.GetSolrPodName(0)), &corev1.Service{})).To(Succeed()))
expectNoService(ctx, solrCloud, solrCloud.GetSolrPodName(2), "Pod-2 service still exists after scale-down")
expectNoService(ctx, solrCloud, solrCloud.GetSolrPodName(1), "Pod-1 service still exists after scale-down")

expectNoPod(ctx, solrCloud, solrCloud.GetSolrPodName(1))
queryCollection(ctx, solrCloud, solrCollection1, 0)
queryCollection(ctx, solrCloud, solrCollection2, 0)
Expand Down

0 comments on commit 7d48a1d

Please sign in to comment.