Skip to content

Instantly share code, notes, and snippets.

@dbaltas
Last active February 8, 2019 01:16
Show Gist options
  • Save dbaltas/4672866 to your computer and use it in GitHub Desktop.
Save dbaltas/4672866 to your computer and use it in GitHub Desktop.
Running Paratest on different database instances
Hi Brian, @brianium
Congratulations on Paratest.
It is a very well written project.
We (as tripsta organization) want to run our test suite in parallel.
Our application is on Zend Framework 1.12, php 5.4, phpunit 3.5.15 and mysql 5.5.
Our test suite has 13000 unit tests and is taking around 22 minutes to run on our testing environment.
Most of the tests have (unfortunately) heavy database access.
The problem is that running phpunit on multiple processes accessing a single same database
generates many deadlocks.
We want to have paratest processes run on different test databases to avoid deadlocks.
This approach would require each child process to connect a separate database.
A suggested solution is:
The main process has a pool of tokens.
When it starts a new child process it passes a token to it.
When it runs out of available tokens, no new process can be created.
When a process ends, the token that was used by this process becomes available.
Any ideas/concerns on this?
In any event we will be working on this implementation in the next couple of days so maybe
you can give it a review or follow up after we are done
on our paratest fork, https://github.com/tripsta/paratest.
In general we are willing to collaborate/contribute on the project.
Keep on the good work!
@hungvietdo
Copy link

Hi Dbaltas,

I am in the same situation where I want to run paratest using multiple databases (to reduce deadlock and mock data setup conflict).

Have you already had resolution regarding to this challenge?

Thank you,
Hung

@kocoten1992
Copy link

@hungvietdo I've similar requirement as yours, (each test runing within it's own database), you might want this https://github.com/liuggio/fastest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment