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

add impl of Test::mysqld::Multi #13

Merged
merged 4 commits into from
Dec 20, 2016
Merged

Conversation

shogo82148
Copy link
Contributor

I often uses Test::mysqld with App::Prove::Plugin::MySQLPool.
App::Prove::Plugin::MySQLPool launches -j number of Test::mysqld instances first,
while the launching process is very slow if the number is large.

I think that Test::mysqld should have an interface for creating some Test::mysqld instances at once.
Your kind consideration of this matter would be sincerely appreciated.

@kazuho
Copy link
Owner

kazuho commented Jun 27, 2015

Thank you for the PR. Can you make the following changes?

  • use the functions provided by Test::mysqld to control the database servers
    • the PR should not includes calls like exec or kill
  • please move the functions into Test::mysqld if it is possible to implement the feature only by adding functions

@shogo82148
Copy link
Contributor Author

Thank you for reviewing.

please move the functions into Test::mysqld if it is possible to implement the feature only by adding functions

I did.

use the functions provided by Test::mysqld to control the database servers

I want to call just exec, but Test::mysqld has no such function.
(start function calls exec, while it calls waitpid too. I want not to call waitpid)

@kazuho
Copy link
Owner

kazuho commented Jul 1, 2015

please move the functions into Test::mysqld if it is possible to implement the feature only by adding functions
I did.

Thank you for the changes.

use the functions provided by Test::mysqld to control the database servers

I want to call just exec, but Test::mysqld has no such function.
(start function calls exec, while it calls waitpid too. I want not to call waitpid)

I understand that your code spawns all the MySQL instances, and then waits for the instances to start up. Does the approach result in non-marginal speed-up compared against when using the start function (i.e. doing fork-exec and wait for each instance)?

If not, please use the start function.

If yes, please refactor the start function, by splitting its two blocks (i.e. spawn and wait-for-startup) to two functions, and call the functions from your multi-daemon startup code. Having same logic at two places of the module is a no-go.

@shogo82148
Copy link
Contributor Author

Does the approach result in non-marginal speed-up compared against when using the start function (i.e. doing fork-exec and wait for each instance)?

Yes.
I refactored.

@Songmu Songmu merged commit 1614ec1 into kazuho:master Dec 20, 2016
shogo82148 added a commit to shogo82148/App-Prove-Plugin-MySQLPool that referenced this pull request Dec 20, 2016
Test::mysqld->start_mysqls was implemented by kazuho/p5-test-mysqld#13
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.

None yet

3 participants