Quantcast

Problem with running tests with mysql database.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with running tests with mysql database.

Anton Samarchyan

I have a pull request in which some tests for some of environments are failing. (it's fine for the default tests with sqlite and some others) - https://github.com/django/django/pull/7994


Now, I am trying to run the tests with the database set to mysql.

I added a file settings_mysql.py which I put in the tests folder: http://pastebin.com/113Xx2Am


To try it out I use the master branch (commit c577d8a4981233b4d0f65c6ce57ae33d304095b9).

Then I run ./runtests.py --settings settings_mysql and I am getting errors.

Then I rerun it with parallel=1 - ./runtests.py --settings settings_mysql --parallel=1

and I get the following result:

FAILED (failures=56, errors=42, skipped=1046, expected failures=4)

Full log - https://paste.ee/p/Tfc9H


Does anyone have an idea what might be wrong and what is the best way to run tests for different databases?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/37fe091c-29f5-40ef-bf0c-c9941cf8e3a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with running tests with mysql database.

Tim Graham-2
For the error, "Database returned an invalid datetime value. Are time zone definitions for your database installed?", see https://docs.djangoproject.com/en/dev/ref/databases/#time-zone-definitions.

Adding this to the 'default' and 'other' dictionaries in DATABASES may solve some of the encoding problems:

'TEST': {
    'CHARSET': 'utf8',
    'COLLATION': 'utf8_general_ci',
},

If you still have some errors after that, please post an updated output.

On Friday, March 10, 2017 at 5:03:51 PM UTC-5, Anton Samarchyan wrote:

I have a pull request in which some tests for some of environments are failing. (it's fine for the default tests with sqlite and some others) - <a href="https://github.com/django/django/pull/7994" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdjango%2Fdjango%2Fpull%2F7994\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGeCFRtxC7KL2cdzbjPRCbDioH7JQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdjango%2Fdjango%2Fpull%2F7994\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGeCFRtxC7KL2cdzbjPRCbDioH7JQ&#39;;return true;">https://github.com/django/django/pull/7994


Now, I am trying to run the tests with the database set to mysql.

I added a file settings_mysql.py which I put in the tests folder: <a href="http://pastebin.com/113Xx2Am" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpastebin.com%2F113Xx2Am\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGsG6GiQnOjfHYJPmvX79xIywUOpg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpastebin.com%2F113Xx2Am\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGsG6GiQnOjfHYJPmvX79xIywUOpg&#39;;return true;">http://pastebin.com/113Xx2Am


To try it out I use the master branch (commit c577d8a4981233b4d0f65c6ce57ae33d304095b9).

Then I run ./runtests.py --settings settings_mysql and I am getting errors.

Then I rerun it with parallel=1 - ./runtests.py --settings settings_mysql --parallel=1

and I get the following result:

FAILED (failures=56, errors=42, skipped=1046, expected failures=4)

Full log - <a href="https://paste.ee/p/Tfc9H" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpaste.ee%2Fp%2FTfc9H\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHsmnmrcp5tW6yXy_zQNhZDAS3zww&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpaste.ee%2Fp%2FTfc9H\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHsmnmrcp5tW6yXy_zQNhZDAS3zww&#39;;return true;">https://paste.ee/p/Tfc9H


Does anyone have an idea what might be wrong and what is the best way to run tests for different databases?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6f86afff-c4c1-481e-8e17-7aae2cf0bde7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with running tests with mysql database.

Adam Johnson-2
For the lock wait timeout errors, it's probable something (another test run?) is still connected to the database and holding the locks. Try restarting mysql.

And if you are still having problems, knowing the version of MySQL you're using, plus how you installed it, would be helpful.

On 10 March 2017 at 22:14, Tim Graham <[hidden email]> wrote:
For the error, "Database returned an invalid datetime value. Are time zone definitions for your database installed?", see https://docs.djangoproject.com/en/dev/ref/databases/#time-zone-definitions.

Adding this to the 'default' and 'other' dictionaries in DATABASES may solve some of the encoding problems:

'TEST': {
    'CHARSET': 'utf8',
    'COLLATION': 'utf8_general_ci',
},

If you still have some errors after that, please post an updated output.

On Friday, March 10, 2017 at 5:03:51 PM UTC-5, Anton Samarchyan wrote:

I have a pull request in which some tests for some of environments are failing. (it's fine for the default tests with sqlite and some others) - https://github.com/django/django/pull/7994


Now, I am trying to run the tests with the database set to mysql.

I added a file settings_mysql.py which I put in the tests folder: http://pastebin.com/113Xx2Am


To try it out I use the master branch (commit c577d8a4981233b4d0f65c6ce57ae33d304095b9).

Then I run ./runtests.py --settings settings_mysql and I am getting errors.

Then I rerun it with parallel=1 - ./runtests.py --settings settings_mysql --parallel=1

and I get the following result:

FAILED (failures=56, errors=42, skipped=1046, expected failures=4)

Full log - https://paste.ee/p/Tfc9H


Does anyone have an idea what might be wrong and what is the best way to run tests for different databases?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/6f86afff-c4c1-481e-8e17-7aae2cf0bde7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Adam

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM1KNVFfJhBO-AbPH15se0TosZe%2BhygeRneTEv%3D0yKuJAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with running tests with mysql database.

Josh Smeaton
In reply to this post by Anton Samarchyan
If you're having issues with specific environments and configuring all of the dependencies, you can try using https://github.com/django/django-box which is a Vagrant virtual machine running on Virtualbox. It has postgres, mysql, sqlite, and all of the pythons Django uses for testing. You could also just take a look at the settings files it uses for testing: https://github.com/django/django-box/tree/master/roles/djangodata/files

On Saturday, 11 March 2017 09:03:51 UTC+11, Anton Samarchyan wrote:

I have a pull request in which some tests for some of environments are failing. (it's fine for the default tests with sqlite and some others) - <a href="https://github.com/django/django/pull/7994" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdjango%2Fdjango%2Fpull%2F7994\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGeCFRtxC7KL2cdzbjPRCbDioH7JQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdjango%2Fdjango%2Fpull%2F7994\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGeCFRtxC7KL2cdzbjPRCbDioH7JQ&#39;;return true;">https://github.com/django/django/pull/7994


Now, I am trying to run the tests with the database set to mysql.

I added a file settings_mysql.py which I put in the tests folder: <a href="http://pastebin.com/113Xx2Am" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpastebin.com%2F113Xx2Am\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGsG6GiQnOjfHYJPmvX79xIywUOpg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpastebin.com%2F113Xx2Am\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGsG6GiQnOjfHYJPmvX79xIywUOpg&#39;;return true;">http://pastebin.com/113Xx2Am


To try it out I use the master branch (commit c577d8a4981233b4d0f65c6ce57ae33d304095b9).

Then I run ./runtests.py --settings settings_mysql and I am getting errors.

Then I rerun it with parallel=1 - ./runtests.py --settings settings_mysql --parallel=1

and I get the following result:

FAILED (failures=56, errors=42, skipped=1046, expected failures=4)

Full log - <a href="https://paste.ee/p/Tfc9H" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpaste.ee%2Fp%2FTfc9H\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHsmnmrcp5tW6yXy_zQNhZDAS3zww&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpaste.ee%2Fp%2FTfc9H\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHsmnmrcp5tW6yXy_zQNhZDAS3zww&#39;;return true;">https://paste.ee/p/Tfc9H


Does anyone have an idea what might be wrong and what is the best way to run tests for different databases?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/78cfa185-0443-4d78-a059-f3c016209d71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...