Closed AntoniaR closed 3 years ago
I think the TraP tests also fail due to this error. The relevant code for the TraP test fail is: https://github.com/transientskp/tkp/blob/fa65950f6a8891e97880e483e03206a06e5f130e/tkp/steps/varmetric.py#L6-L25
The TraP tests error message is:
======================================================================
ERROR: test_execute_store_varmetric (test_varmetric.TestApi)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoniar/TraP_Develop/tkp/tests/test_steps/test_varmetric.py", line 43, in test_execute_store_varmetric
execute_store_varmetric(session=session, dataset_id=self.dataset.id)
File "/home/antoniar/TraP_Develop/tkp/tkp/steps/varmetric.py", line 22, in execute_store_varmetric
session.execute(delete_)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1643, in execute
_parent_execute_state is not None,
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1821, in orm_pre_session_exec
update_options,
File "/home/antoniar/TraP_Develop_Env/local/lib/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: "Cannot evaluate Select". Specify 'fetch' or False for the synchronize_session execution option.
-------------------- >> begin captured logging << --------------------
tkp.db.database: INFO: connecting to database...
tkp.db.database: INFO: connected to: postgresql://antoniar@vlo.science.uva.nl:5432/AR_testing
--------------------- >> end captured logging << ---------------------
This also produces another tests error:
======================================================================
ERROR: test_execute_store_varmetric_twice (test_varmetric.TestApi)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoniar/TraP_Develop/tkp/tests/test_steps/test_varmetric.py", line 48, in test_execute_store_varmetric_twice
execute_store_varmetric(session=session, dataset_id=self.dataset.id)
File "/home/antoniar/TraP_Develop/tkp/tkp/steps/varmetric.py", line 22, in execute_store_varmetric
session.execute(delete_)
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1643, in execute
_parent_execute_state is not None,
File "/home/antoniar/TraP_Develop_Env/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 1821, in orm_pre_session_exec
update_options,
File "/home/antoniar/TraP_Develop_Env/local/lib/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: "Cannot evaluate Select". Specify 'fetch' or False for the synchronize_session execution option.
Interesting the TraP test suite passes completely when using an earlier version of sqlalchemy (see Issue #586). Testing underway to determine if it completely solves this issue.
In some cases, TraP creates a new running catalogue source after a new source is detected. This source can then be retrospectively associated with an existing running catalogue source and TraP deletes the source from the database.
Unfortunately, TraP does not seem to be deleting the source correctly from all the associated tables. It seems to be deleted from the running catalogue fine, but not the varmetric catalogue. We need to check that, when a running catalogue source is deleted, it is deleted from all tables that reference it.
The full log is attached to this issue but the relevant part is:
FirstTry_trap.log