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

[py2py3] Syntax error when dropping MariaDB database #10502

Closed
amaltaro opened this issue May 25, 2021 · 0 comments · Fixed by #10504
Closed

[py2py3] Syntax error when dropping MariaDB database #10502

amaltaro opened this issue May 25, 2021 · 0 comments · Fixed by #10504

Comments

@amaltaro
Copy link
Contributor

Impact of the bug
WMCore unit tests

Describe the bug
While commissioning the Python3 Jenkins CI, I noticed many unit tests failing with a syntax error when clearing the test SQL database, see [1].

How to reproduce it
Running this module unit tests:
WMCore_t/WMBS_t/JobSplitting_t/EventBased_t.py
with this option:

--reallyDeleteMyDatabaseAfterEveryTest=true

Expected behavior
Fix the SQL syntax such that we can run unit tests in BOT mode and cleaning up the database between tests.

Additional context and error message
[1]

======================================================================
ERROR: _test150EventMultipleFileSplit_
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/cmsbld/jenkins/workspace/DMWM-WMAgentPy3-TestAll/SLICE/2/label/cms-dmwm-cc7/code/test/python/WMCore_t/WMBS_t/JobSplitting_t/EventBased_t.py", line 43, in setUp
    self.testInit.setDatabaseConnection(destroyAllDatabase=True)
  File "/build/cmsbld/jenkins/workspace/DMWM-WMAgentPy3-TestAll/SLICE/2/label/cms-dmwm-cc7/code/src/python/WMQuality/TestInit.py", line 154, in setDatabaseConnection
    self.clearDatabase()
  File "/build/cmsbld/jenkins/workspace/DMWM-WMAgentPy3-TestAll/SLICE/2/label/cms-dmwm-cc7/code/src/python/WMQuality/TestInit.py", line 285, in clearDatabase
    self.init.clearDatabase()
  File "/build/cmsbld/jenkins/workspace/DMWM-WMAgentPy3-TestAll/SLICE/2/label/cms-dmwm-cc7/code/src/python/WMCore/WMInit.py", line 205, in clearDatabase
    raise WMInitException(msg)
WMCore.WMInit.WMInitException: <@========== WMException Start ==========@>
Exception Class: WMInitException
Message: Critical error while attempting to delete entire DB!
(MySQLdb._exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'b'WMCore_unit_test'' at line 1")
[SQL: DROP DATABASE b'WMCore_unit_test']
@amaltaro amaltaro added BUG Jenkins High Priority Python3 py3 potential bug Related to changes that may cause bugs in py3 labels May 25, 2021
@amaltaro amaltaro self-assigned this May 25, 2021
@amaltaro amaltaro added this to To do in Planned for Q2 - 2021 via automation May 25, 2021
@amaltaro amaltaro moved this from To do to Work in progress in Planned for Q2 - 2021 May 25, 2021
@amaltaro amaltaro added this to WMCore py2->py2py3: Bugs, tests and follow-up in Python3 support May 25, 2021
@amaltaro amaltaro changed the title Syntax error when dropping MariaDB database [py2py3] Syntax error when dropping MariaDB database May 26, 2021
@mapellidario mapellidario self-assigned this May 26, 2021
@amaltaro amaltaro removed their assignment May 26, 2021
Python3 support automation moved this from WMCore py2->py2py3: Bugs, tests and follow-up to Issues Closed May 26, 2021
Planned for Q2 - 2021 automation moved this from Work in progress to Work Done (issues only) May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG High Priority Jenkins py3 potential bug Related to changes that may cause bugs in py3 Python3
Projects
Python3 support
  
Issues Closed
Planned for Q2 - 2021
Work Done (issues only)
Development

Successfully merging a pull request may close this issue.

2 participants