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

fix: ping solr version to fix e2e test #6544

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions tests/scalers/solr/solr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ spec:
spec:
containers:
- name: solr
image: solr:latest
image: solr:8
ports:
- containerPort: 8983
volumeMounts:
Expand Down Expand Up @@ -229,12 +229,11 @@ func setupSolr(t *testing.T, kc *kubernetes.Clientset) {
func checkIfSolrStatusIsReady(t *testing.T, name string) error {
t.Log("--- checking solr status ---")

time.Sleep(time.Second * 10)
for i := 0; i < 60; i++ {
for i := 0; i < 12; i++ {
out, errOut, _ := ExecCommandOnSpecificPod(t, name, testNamespace, fmt.Sprintf("%s status", solrPath))
t.Logf("Output: %s, Error: %s", out, errOut)
if !strings.Contains(out, "running on port") {
time.Sleep(time.Second * 10)
time.Sleep(time.Second * 5)
continue
}
return nil
Expand Down Expand Up @@ -292,7 +291,13 @@ func testScaleOut(t *testing.T, kc *kubernetes.Clientset) {
func testScaleIn(t *testing.T, kc *kubernetes.Clientset) {
t.Log("--- testing scale in ---")

_, _, err := ExecCommandOnSpecificPod(t, solrPodName, testNamespace, fmt.Sprintf("curl -u %s:%s -X POST 'http://localhost:8983/solr/%s/update' --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'", solrUsername, solrPassword, solrCollection))
// Delete documents
out, errOut, err := ExecCommandOnSpecificPod(t, solrPodName, testNamespace, fmt.Sprintf("curl -u %s:%s -X POST 'http://localhost:8983/solr/%s/update' --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'", solrUsername, solrPassword, solrCollection))
t.Logf("Output: %s, Error: %s", out, errOut)
// Commit changes
out, errOut, _ = ExecCommandOnSpecificPod(t, solrPodName, testNamespace, fmt.Sprintf("curl -u %s:%s -X POST 'http://localhost:8983/solr/%s/update' --data-binary '{\"commit\":{}}' -H 'Content-type:application/json'", solrUsername, solrPassword, solrCollection))
t.Logf("Output: %s, Error: %s", out, errOut)

assert.NoErrorf(t, err, "cannot enqueue messages - %s", err)
assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, minReplicaCount, 60, 3),
"replica count should be %d after 3 minutes", minReplicaCount)
Expand Down