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

integration tests: wait for index creation #407

Merged
merged 3 commits into from
Apr 11, 2019
Merged

integration tests: wait for index creation #407

merged 3 commits into from
Apr 11, 2019

Conversation

smacker
Copy link
Contributor

@smacker smacker commented Apr 4, 2019

Fix: #378

@smacker smacker requested a review from a team April 4, 2019 14:14
Copy link
Contributor

@dpordomingo dpordomingo left a comment

Choose a reason for hiding this comment

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

I reviewed only last commit 3f4bdd7, and LGTM.

(the comment 👇 is not blocker)

visibleValue := strings.TrimSpace(strings.Split(indexLine, "|")[14])
var visibleValue string
// building/loading index takes some time, wait maximum 15s
for i := 0; i < 15; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

For the simple index we are creating in this testcase, 15s can be enough.
with bigger datasets (as could be needed in the future), it would not be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

15s is a lot. I would prefer it to fail when we add such a big dataset. And increase timeout/reduce dataset depends on the case.

@se7entyse7en
Copy link
Contributor

I have found only one place where we were checking index only with 1s sleep.

Yup the only other place is still unmerged in #363.

@smacker
Copy link
Contributor Author

smacker commented Apr 5, 2019

Ok. I'll wait for it to be merged and then rebase.

@dpordomingo dpordomingo added the enhancement New feature or request label Apr 9, 2019
@smacker
Copy link
Contributor Author

smacker commented Apr 10, 2019

I have reworked the PR due to different check in regression test. Please another pass.

return visibleValue
}

func hasIndex(s commandSuite, table, name string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the visible column have other values than "YES" and "NO"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

according to mysql documentation no. At least there is no mention of any other value.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd then change the return value to bool so that the handling of "YES" and "NO" values is done only within this function.

@se7entyse7en
Copy link
Contributor

LGTM 👍

s.Require().NoError(r.Error, r.Combined())

// parse result and check that correct index was built and it is visiable
lines := strings.Split(r.Stdout(), "\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could add an example output. This way if the format changes in the future we can compare it and fix the code easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a link instead of output itself (it's huge). The link contains version of mysql so it won't change.

Signed-off-by: Maxim Sukharev <[email protected]>
@smacker smacker merged commit ac407ec into src-d:master Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants