Closed simonw closed 1 year ago
All three of the cancelled ones reported the same almost-complete status:
platform linux -- Python 3.11.1, pytest-7.2.1, pluggy-1.0.0 -- /opt/hostedtoolcache/Python/3.11.1/x64/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/db-to-sqlite/db-to-sqlite
collecting ... collected 19 items
tests/test_db_to_sqlite.py::test_db_to_sqlite[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 5%]
tests/test_db_to_sqlite.py::test_db_to_sqlite[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 10%]
tests/test_db_to_sqlite.py::test_db_to_sqlite[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 15%]
tests/test_db_to_sqlite.py::test_index_fks[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 21%]
tests/test_db_to_sqlite.py::test_index_fks[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 26%]
tests/test_db_to_sqlite.py::test_index_fks[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 31%]
tests/test_db_to_sqlite.py::test_specific_tables[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 36%]
tests/test_db_to_sqlite.py::test_specific_tables[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 42%]
tests/test_db_to_sqlite.py::test_specific_tables[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 47%]
tests/test_db_to_sqlite.py::test_sql_query[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 52%]
tests/test_db_to_sqlite.py::test_sql_query[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 57%]
tests/test_db_to_sqlite.py::test_sql_query[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 63%]
tests/test_db_to_sqlite.py::test_postgres_schema PASSED [ 68%]
tests/test_docs.py::test_readme_contains_latest_help PASSED [ 73%]
tests/test_fixtures.py::test_fixture_mysql PASSED [ 78%]
tests/test_fixtures.py::test_fixture_postgresql PASSED [ 84%]
tests/test_redact.py::test_redact[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 89%]
tests/test_redact.py::test_redact[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 94%]
Error: The operation was canceled.
Deduped the tests that pass are:
test_db_to_sqlite.py::test_db_to_sqlite
test_db_to_sqlite.py::test_index_fks
test_db_to_sqlite.py::test_postgres_schema
test_db_to_sqlite.py::test_specific_tables
test_db_to_sqlite.py::test_sql_query
test_docs.py::test_readme_contains_latest_help
test_fixtures.py::test_fixture_mysql
test_fixtures.py::test_fixture_postgresql
test_redact.py::test_redact
When I run locally there's only one test that isn't in that list:
test_postgres_schema
This test here:
The SQL for creating that other schema looked odd to me:
Shouldn't that have a semicolon after CREATE SCHEMA other_schema
?
The tests have been passing for a couple of years so apparently that worked OK before though.
Weird: this workaround got 3.10 to pass but still seems to hang for 3.9 and 3.11.
https://github.com/simonw/db-to-sqlite/actions/runs/4109240953/jobs/7090852122
Still hanging for 3.9 and 3.11: https://github.com/simonw/db-to-sqlite/actions/runs/4109280459/jobs/7090938290
It gets this far still:
tests/test_redact.py::test_redact[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 89%]
tests/test_redact.py::test_redact[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 94%]
It looks like the last of the series of test_redact
tests might be hanging - that's the second PostgreSQL one that uses postgres://
as the connection string instead of postgresql://
:
Maybe more likely though is that the code that tears down the PostgreSQL test servers is hanging for some reason.
Urgh. Removing that postgres://
thing didn't fix the problem either.
https://github.com/simonw/db-to-sqlite/actions/runs/4109349112/jobs/7091083066
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0 -- /opt/hostedtoolcache/Python/3.8.16/x64/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/db-to-sqlite/db-to-sqlite
collecting ... collected 14 items
tests/test_db_to_sqlite.py::test_db_to_sqlite[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 7%]
tests/test_db_to_sqlite.py::test_db_to_sqlite[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 14%]
tests/test_db_to_sqlite.py::test_index_fks[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 21%]
tests/test_db_to_sqlite.py::test_index_fks[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 28%]
tests/test_db_to_sqlite.py::test_specific_tables[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 35%]
tests/test_db_to_sqlite.py::test_specific_tables[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 42%]
tests/test_db_to_sqlite.py::test_sql_query[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 50%]
tests/test_db_to_sqlite.py::test_sql_query[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 57%]
tests/test_db_to_sqlite.py::test_postgres_schema PASSED [ 64%]
tests/test_docs.py::test_readme_contains_latest_help PASSED [ 71%]
tests/test_fixtures.py::test_fixture_mysql PASSED [ 78%]
tests/test_fixtures.py::test_fixture_postgresql PASSED [ 85%]
tests/test_redact.py::test_redact[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 92%]
Error: The operation was canceled.
There's still something which is causing the tests to hang towards the end of the run.
Still the same problem: https://github.com/simonw/db-to-sqlite/actions/runs/4109380335/jobs/7091148981
Even skipping the test_redact()
test - so it's clearly not that test that is causing the problem:
platform linux -- Python 3.9.16, pytest-7.2.1, pluggy-1.0.0 -- /opt/hostedtoolcache/Python/3.9.16/x64/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/db-to-sqlite/db-to-sqlite
collecting ... collected 19 items
tests/test_db_to_sqlite.py::test_db_to_sqlite[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 5%]
tests/test_db_to_sqlite.py::test_db_to_sqlite[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 10%]
tests/test_db_to_sqlite.py::test_db_to_sqlite[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 15%]
tests/test_db_to_sqlite.py::test_index_fks[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 21%]
tests/test_db_to_sqlite.py::test_index_fks[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 26%]
tests/test_db_to_sqlite.py::test_index_fks[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 31%]
tests/test_db_to_sqlite.py::test_specific_tables[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 36%]
tests/test_db_to_sqlite.py::test_specific_tables[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 42%]
tests/test_db_to_sqlite.py::test_specific_tables[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 47%]
tests/test_db_to_sqlite.py::test_sql_query[mysql://root@127.0.0.1:3306/test_db_to_sqlite] PASSED [ 52%]
tests/test_db_to_sqlite.py::test_sql_query[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 57%]
tests/test_db_to_sqlite.py::test_sql_query[***127.0.0.1:5432/test_db_to_sqlite] PASSED [ 63%]
tests/test_db_to_sqlite.py::test_postgres_schema PASSED [ 68%]
tests/test_docs.py::test_readme_contains_latest_help PASSED [ 73%]
tests/test_fixtures.py::test_fixture_mysql PASSED [ 78%]
tests/test_fixtures.py::test_fixture_postgresql PASSED [ 84%]
tests/test_redact.py::test_redact[mysql://root@127.0.0.1:3306/test_db_to_sqlite] SKIPPED (https://github.com/simonw/db-to-sqlite/issues/47) [ 89%]
tests/test_redact.py::test_redact[***127.0.0.1:5432/test_db_to_sqlite] SKIPPED (https://github.com/simonw/db-to-sqlite/issues/47) [ 94%]
Error: The operation was canceled.
https://pybit.es/articles/pytest-timeout/ suggests using pytest-timeout
and running it with these options in order to get a detailed traceback:
pytest --timeout=3 --timeout_method=thread
One of the MySQL tests failed with the timeout!
https://github.com/simonw/db-to-sqlite/actions/runs/4109415108/jobs/7091221231
File "/home/runner/work/db-to-sqlite/db-to-sqlite/tests/conftest.py", line 171, in setup_mysql
cursor.execute("DROP DATABASE {};".format(bits.database))
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/MySQLdb/connections.py", line 254, in query
_mysql.connection.query(self, query)
+++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++
Error: Process completed with exit code 1.
Looks like it failed during an attempt to drop the database.
The PostgreSQL fixture doesn't actually bother trying to drop the database - I've removed that from the MySQL one too.
Yup, the MySQL teardown change fixed it.
My best guess is there was a transaction left open which was blocking the DROP DATABASE
from running - absolutely no idea why that would only affect some versions of Python and not others though.
https://github.com/simonw/db-to-sqlite/actions/runs/4109081649
I hit cancel workflow when it was clear three of them were not going to finish.