I tried bench run-tests --app frappe. Tons of error occured, most of which are of the same type like this:
======================================================================
ERROR: setUpClass (frappe.tests.test_linked_with.TestLinkedWith)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/frapper/erpnext/apps/frappe/frappe/tests/utils.py", line 27, in setUpClass
frappe.db.commit()
File "/home/frapper/erpnext/apps/frappe/frappe/database/database.py", line 968, in commit
self.sql("commit")
File "/home/frapper/erpnext/apps/frappe/frappe/database/database.py", line 209, in sql
self._cursor.execute(query, values)
File "/home/frapper/erpnext/env/lib/python3.10/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/frapper/erpnext/env/lib/python3.10/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/frapper/erpnext/env/lib/python3.10/site-packages/pymysql/connections.py", line 547, in query
self._execute_command(COMMAND.COM_QUERY, sql)
File "/home/frapper/erpnext/env/lib/python3.10/site-packages/pymysql/connections.py", line 793, in _execute_command
raise err.InterfaceError(0, "")
pymysql.err.InterfaceError: (0, '')
Here is the relevant connections.py code:
def _execute_command(self, command, sql):
"""
:raise InterfaceError: If the connection is closed.
:raise ValueError: If no username was specified.
"""
if not self._sock:
raise err.InterfaceError(0, "")
The db server works fine, why does it fail to be connected during testing? Is it due to too many connections?