This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Mysql + unittest crash
Type: crash Stage: resolved
Components: Library (Lib) Versions: Python 3.8
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: lgerosa, remi.lapeyre
Priority: normal Keywords:

Created on 2020-05-27 01:50 by lgerosa, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg370039 - (view) Author: Lucas (lgerosa) Date: 2020-05-27 01:50
environment: win10 cmd, python 3.8 32-bit, mysql, unittest

description: When restoring a database through mysql in a unittest function, the command prompt freezes before giving the result of the test, and I am forced to close it to quit.

steps to replicate: Have mysql installed, create a database with some content, dump the latter in a file, create a unit test using python's unittest with at least two test functions, and restore the file in one of them.
msg370055 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2020-05-27 08:49
Hi Lucas, this is probably not an issue with unittest but a bug in the test themselves. Can you attach an example to reproduce the issue?
msg370117 - (view) Author: Lucas (lgerosa) Date: 2020-05-27 17:47
While trying to simplify my program for you, I found that the problem was caused by a very specific interaction of one of the functions that was being tested with the restore command, which did not happen when I tried to rule this problem out in other ways.

Anyways, thank you for your time.
msg370119 - (view) Author: Lucas (lgerosa) Date: 2020-05-27 18:58
The problem was that I didn't close the 1st connection to the database and then made another request, which had to wait for the 1st to close, to be exact.
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84964
2020-05-27 18:58:13lgerosasetmessages: + msg370119
2020-05-27 17:47:10lgerosasetstatus: open -> closed
resolution: not a bug
messages: + msg370117

stage: resolved
2020-05-27 08:49:33remi.lapeyresetnosy: + remi.lapeyre
messages: + msg370055
2020-05-27 01:50:46lgerosacreate