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 test failures on MariaDB #1193

Merged
merged 7 commits into from May 19, 2021

Conversation

junaruga
Copy link
Contributor

@junaruga junaruga commented Apr 16, 2021

This PR fixes #965 and fixes #1152 test failures related to MariaDB.

Please check each commit's comment.
Thanks.

Fix the test failures in statement_spec.rb on MariaDB 10.5.

On MariaDB >= 10.0, the peformance schema is disabled.
https://jira.mariadb.org/browse/MDEV-6726

And on MariaDB 10.5, the followwing code used in the test doesn't
raise `Mysql2:Error`, just returning 0, even when if the performance_schema is disabled.

```
@client.query("SELECT COUNT(1) AS count FROM performance_schema.prepared_statements_instances")
```
Fix the test failures in client_spec.rb on MariaDB.

On MariaDB >= 10.0, the setting of the peformance schema is disabled by defult.
https://jira.mariadb.org/browse/MDEV-6726

You can comfirm the status by the SQL `SHOW VARIABLES LIKE 'performance_schema`.
MariaDB 10.5 returns a little different error message unlike MySQL
and other old MariaDBs.
https://jira.mariadb.org/browse/MDEV-25400 .
Install rubygem-json RPM package in Fedora container as it is used in rake.

```
LoadError: cannot load such file -- json
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/formatter/json_formatter.rb:3:in `require'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/formatter/json_formatter.rb:3:in `<top (required)>'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop.rb:524:in `require'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop.rb:524:in `<top (required)>'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/rake_task.rb:44:in `require'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/rake_task.rb:44:in `run_cli'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/rake_task.rb:36:in `run_main_task'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/rake_task.rb:28:in `block (2 levels) in initialize'
/build/vendor/bundle/ruby/3.0.0/gems/rubocop-0.50.0/lib/rubocop/rake_task.rb:26:in `block in initialize'
/build/vendor/bundle/ruby/3.0.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
```
Copy link
Collaborator

@sodabrew sodabrew left a comment

Choose a reason for hiding this comment

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

Looks excellent, thank you for running this down!

@sodabrew
Copy link
Collaborator

There are still some test failures after removing the last allow-fail, though?

@junaruga
Copy link
Contributor Author

junaruga commented Apr 16, 2021

There are still some test failures after removing the last allow-fail, though?

Yes. For CI cases I removed the allow-fail, there is no test failures any more.

But there are still roughly 2 kind of test failures in other CI cases.

  1. The test failures from the mysql80: Mysql2::Client session_track fails on mysql >= 8.0.20 or 8.0.21? #1165 issue.
- {os: ubuntu-20.04, ruby: 2.4, db: mariadb10.3, allow-failure: true}

After the PR #1183 will be merged, there is only the issue: #1165 issue
This commit 7b563b8 in the commits of on the PR #1183 is to fix the issue not starting MariaDB.

# Allow failure due to the issue #1165.
- {os: ubuntu-20.04, ruby: 2.4, db: mysql80, allow-failure: true}
- {os: macos-latest, ruby: 2.4, db: mysql, allow-failure: true}

We might be able to fix this case with the same way on the PR #1183. I assume MySQL's library might be used on the MariaDB 10.0 case.

# Allow failure due to Mysql2::Error: Unknown system variable 'session_track_system_variables'.
- {os: ubuntu-16.04, ruby: 2.4, db: mariadb10.0, allow-failure: true}

@junaruga
Copy link
Contributor Author

junaruga commented Apr 16, 2021

Travis mysql55 started error since yesterday due to a package repository not found.
https://travis-ci.org/github/brianmario/mysql2/jobs/767276558

E: Failed to fetch https://downloads.apache.org/cassandra/debian/dists/39x/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch https://downloads.apache.org/cassandra/debian/dists/39x/main/binary-i386/Packages  404  Not Found

@junaruga
Copy link
Contributor Author

junaruga commented Apr 16, 2021

I see that macOS MariaDB case Mysql2::EM::Client fails for this PR. I think it rarely happens. I saw it in the past.
https://github.com/brianmario/mysql2/pull/1193/checks?check_run_id=2363155750#step:9:536

So, I can add the allow_failure to the macOS MariaDB case again if you like.

The tests pass now.

Still keep allow-failure on macOS MariaDB case due to test failures that rarely happens.
@junaruga
Copy link
Contributor Author

So, I can add the allow_failure to the macOS MariaDB case again if you like.

I rebased the last allow-fail's commit keeping allow_failure to the macOS MariaDB case.
I also added one more commit to add allow_failures to mysql55 case in Travis for now.

@junaruga
Copy link
Contributor Author

I also added one more commit to add allow_failures to mysql55 case in Travis for now.

I think an possible alternative of mysql55 could be mysql56 on xenial or trusty if the mysql55's repo issue will be not fixed.

http://repo.mysql.com/apt/ubuntu/dists/xenial/
http://repo.mysql.com/apt/ubuntu/dists/trusty/

@junaruga
Copy link
Contributor Author

@sodabrew ping.

@junaruga
Copy link
Contributor Author

junaruga commented May 9, 2021

Finally travis-ci.org shut down will occur on May 31, 2021. You can see #1149 (comment) for detail.

@sodabrew sodabrew merged commit a825ba1 into brianmario:master May 19, 2021
@junaruga junaruga deleted the wip/fix-tests-mariadb branch May 19, 2021 17:00
@junaruga
Copy link
Contributor Author

Thanks for finding my typos and the merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests failing with mariadb10.5: Mysql2::Statement Test failures on MariaDB performance_schema: OFF
2 participants