Skip to content

Integration tests failing with SQLAlchemy 1.4 #5071

Description

@chaen

There seem to have been some changes in the API of SQLAlchemy which needs a bit of adaptation in our code.
Namely https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#orm-query-is-internally-unified-with-select-update-delete-2-0-style-execution-available

PR to follow

the error show up in the integration tests

      # Now we monitor again, job one, and find out that job1 has disappeared
      # So we cancel the job and the files
      res = self.db.cancelNonExistingJob(opID, job1GUID)
>     self.assertTrue(res['OK'])
E     AssertionError: False is not true

ServerInstallDIR/DIRAC/tests/Integration/DataManagementSystem/Test_Client_FTS3.py:435: AssertionError
----------------------------- Captured stdout call -----------------------------
cancelNonExistingJob: unexpected exception
Traceback (most recent call last):
  File "/home/dirac/ServerInstallDIR/DIRAC/DataManagementSystem/DB/FTS3DB.py", line 482, in cancelNonExistingJob
    session.execute(updStmt)
  File "/home/dirac/ServerInstallDIR/diracos/usr/lib64/python2.7/site-packages/sqlalchemy/orm/session.py", line 1625, in execute
    _parent_execute_state is not None,
  File "/home/dirac/ServerInstallDIR/diracos/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1821, in orm_pre_session_exec
    update_options,
  File "/home/dirac/ServerInstallDIR/diracos/usr/lib64/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1949, in _do_pre_synchronize_evaluate
    from_=err,
  File "<string>", line 5, in raise_
InvalidRequestError: Could not evaluate current criteria in Python: "Can't evaluate criteria against alternate class <class 'DIRAC.DataManagementSystem.Client.FTS3File.FTS3File'>". Specify 'fetch' or False for the synchronize_session execution option.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions