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

Can't initialise MySQL 5.7 in Ubuntu 16.04 (in-memory) #11

Open
olegpidsadnyi opened this issue Dec 2, 2016 · 1 comment
Open

Can't initialise MySQL 5.7 in Ubuntu 16.04 (in-memory) #11

olegpidsadnyi opened this issue Dec 2, 2016 · 1 comment

Comments

@olegpidsadnyi
Copy link
Contributor

There are few issues noticed while trying mysql fixture in Ubuntu 16.04 and MySQL 5.7.

Ubuntu is changing /dev/shm to /run/shm.
MySQL is changing instantiation to "mysqld --initialize".
MySQL can't initialise data folder unless it doesn't exist. So creation of the defaults.cnf has to be stored in another directory.
MySQL can't access (read/write) folders that pytest process is creating in the /run/shm, including tmp.

It might become problematic with upgrades of Ubuntu.

@bubenkoff
Copy link
Member

I think the solution is to simply use docker for most if not all services:

@pytest.fixture(scope='session')
def mysql_watcher(
        request, run_services, watcher_getter, mysql_system_database, mysql_pid, mysql_socket, mysql_data_dir,
        mysql_defaults_file):
    """The mysqld process watcher."""
    if run_services:
        return watcher_getter('docker', [
           'run',
           '--rm',
           '-e',
           'MYSQL_ROOT_PASSWORD={0}'.format(mysql_password),
           'mysql:{0}'.format(mysql_version),
        ], checker=lambda: os.path.exists(mysql_socket))

of course it requires docker to be installed for test nodes, but ONLY docker then, and not all kinds of outdated software rubbish

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

No branches or pull requests

2 participants