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

Remove race condition by disabling esIndexCleaner till after SmokeTes… #437

Merged
merged 2 commits into from
May 28, 2019
Merged
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: 12 additions & 3 deletions test/e2e/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"testing"

"k8s.io/apimachinery/pkg/types"
framework "github.com/operator-framework/operator-sdk/pkg/test"
"github.com/operator-framework/operator-sdk/pkg/test/e2eutil"
log "github.com/sirupsen/logrus"
Expand All @@ -26,6 +27,8 @@ type ElasticSearchTestSuite struct {
suite.Suite
}

var esEnabled = false

func(suite *ElasticSearchTestSuite) SetupSuite() {
t = suite.T()
var err error
Expand Down Expand Up @@ -103,9 +106,6 @@ func (suite *ElasticSearchTestSuite) TestSimpleProd() {
}

func (suite *ElasticSearchTestSuite) TestEsIndexCleaner() {
// Skip until https://github.com/jaegertracing/jaeger/issues/1468 is fixed
t.Skip()

name := "test-es-index-cleaner"
j := getJaegerAllInOne(name)

Expand All @@ -128,6 +128,14 @@ func (suite *ElasticSearchTestSuite) TestEsIndexCleaner() {
err = SmokeTest("http://localhost:16686/api/traces", "http://localhost:14268/api/traces", "foo-bar", retryInterval, timeout)
require.NoError(t, err, "Error running smoketest")

// Once we've created a span with the smoke test, enable the index cleaer
key := types.NamespacedName{Name:name, Namespace:namespace}
err = fw.Client.Get(context.Background(), key, j)
require.NoError(t, err)
esEnabled = true
err = fw.Client.Update(context.Background(), j)
require.NoError(t, err)

esPod, err := GetPod(storageNamespace, "elasticsearch", "elasticsearch", fw.KubeClient)
require.NoError(t, err, "Error getting Pod")

Expand Down Expand Up @@ -196,6 +204,7 @@ func getJaegerAllInOne(name string) *v1.Jaeger {
"es.server-urls": esServerUrls,
}),
EsIndexCleaner: v1.JaegerEsIndexCleanerSpec{
Enabled: &esEnabled,
Schedule: "*/1 * * * *",
NumberOfDays: &numberOfDays,
},
Expand Down