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 race condition in test, remove hard-coded namespace #382

Merged
merged 3 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion test/e2e/es_index_cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func esIndexCleanerTest(t *testing.T, f *framework.Framework, testCtx *framework
return err
}

esPod, err := GetPod("default", "elasticsearch", "elasticsearch", f.KubeClient)
esPod, err := GetPod(storageNamespace, "elasticsearch", "elasticsearch", f.KubeClient)
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/smoketest.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func SmokeTest(apiTracesEndpoint, collectorEndpoint, serviceName string, interva
bodyBytes, err := ioutil.ReadAll(resp.Body)
bodyString := string(bodyBytes)

if !strings.Contains(bodyString, "errors\":null") {
if (strings.Contains(bodyString, tStr)) {
return true, nil
} else if !strings.Contains(bodyString, "errors\":null") {
Copy link
Member

Choose a reason for hiding this comment

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

Keep the errors check separate from the expected spas and move it above it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pavolloffay Are you ok with these changes?

return false, errors.New("query service returns errors")
}
if !strings.Contains(bodyString, tStr) {
return false, errors.New("query service does not return spans")
}
return true, nil

return false, nil
})
}