Collect CI logs flaky test
This an issue to collect the logs of the CI runs that fail inconsistently. Please commit the raw log (download by Download log archive) of the failed tests to the branch flaky-tests-logs. Create a new folder with the full commit hash and reference the PR and the short commit hash in the commit message. Also if possible put here a snippet of the error message here together with the commit hash on the branch flaky-tests-logs. We do it so complicated as GitHub expires files when uploaded in the issue directly.
There is already this issue https://github.com/aiidateam/aiida-core/issues/4281 but since there are no logs of the runs, and the CI runs are already expired, and the line numbers are also not up to date. It is a bit hard to continue from this discussion.
d7d65c9b18e49e339eb14bd5be3cff0a655f667f
_____________________________ test_unload_profile ______________________________
[gw0] linux -- Python 3.13.3 /home/runner/work/aiida-core/aiida-core/.venv/bin/python3
def test_unload_profile():
"""Test that unloading the profile closes all sqla sessions.
This is a regression test for #5506.
"""
import gc
from sqlalchemy.orm.session import _sessions
# Run the garbage collector to ensure any lingering unrelated sessions do not cause the test to fail.
gc.collect()
# Just running the test suite itself should have opened at least one session
current_sessions = len(_sessions)
> assert current_sessions != 0, str(_sessions)
E AssertionError: <WeakValueDictionary at 0x7fe2db11da30>
E assert 0 != 0
tests/storage/psql_dos/test_backend.py:153: AssertionError
On PR #6847 tests/restapi/test_statistics.py failed many times, with no apparent reason.
We ignored and after a week passed.
There's no connection between the commits that was merged in the meantime. Therefore I'd mark as flaky.
(Also in the passed the very same test was failing on a different PR, which by re-running passed successfully.)
____________________________ test_count_consistency ____________________________
[gw1] linux -- Python 3.9.22 /home/runner/work/aiida-core/aiida-core/.venv/bin/python3
restapi_server = <function restapi_server.<locals>._restapi_server at 0x7f43030aff70>
server_url = <function server_url.<locals>._server_url at 0x7f43002acc10>
@pytest.mark.usefixtures('populate_restapi_database')
def test_count_consistency(restapi_server, server_url):
"""Test the consistency in values between full_type_count and statistics"""
server = restapi_server()
server_thread = Thread(target=server.serve_forever)
_server_url = server_url(port=server.server_port)
try:
server_thread.start()
type_count_response = requests.get(f'{_server_url}/nodes/full_types_count', timeout=10)
statistics_response = requests.get(f'{_server_url}/nodes/statistics', timeout=10)
finally:
server.shutdown()
> type_count_dict = linearize_namespace(type_count_response.json()['data'])
tests/restapi/test_statistics.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/restapi/test_statistics.py:31: in linearize_namespace
linearize_namespace(subspace, linear_namespace)
tests/restapi/test_statistics.py:31: in linearize_namespace
linearize_namespace(subspace, linear_namespace)
tests/restapi/test_statistics.py:31: in linearize_namespace
linearize_namespace(subspace, linear_namespace)
tests/restapi/test_statistics.py:31: in linearize_namespace
linearize_namespace(subspace, linear_namespace)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tree_namespace = {'counter': 5, 'full_type': None, 'label': 'Unregistered', 'namespace': '~no-entry-point~', ...}
linear_namespace = {'data.': 156, 'data.Data.': 20, 'data.core.': [136](https://github.com/aiidateam/aiida-core/actions/runs/14864011669/job/41740571178?pr=6847#step:7:137), 'data.core.array.': 5, ...}
def linearize_namespace(tree_namespace, linear_namespace=None):
"""Linearize a branched namespace with full_type, count, and subspaces"""
if linear_namespace is None:
linear_namespace = {}
full_type = tree_namespace['full_type']
> while full_type[-1] != '.':
E TypeError: 'NoneType' object is not subscriptable
tests/restapi/test_statistics.py:23: TypeError
Full log: https://github.com/aiidateam/aiida-core/actions/runs/14864011669/job/42124229472
Changes in the entry points in PR #6884 resulted in failure of tests/restapi/test_statistics.py::test_count_consistency. The error message is not consistent. Happens only for py3.9 sqlite 3.9
____________________________ test_count_consistency ____________________________
[gw0] linux -- Python 3.9.22 /home/runner/work/aiida-core/aiida-core/.venv/bin/python3
restapi_server = <function restapi_server.<locals>._restapi_server at 0x7f3568fadca0>
server_url = <function server_url.<locals>._server_url at 0x7f3558db9af0>
@pytest.mark.usefixtures('populate_restapi_database')
def test_count_consistency(restapi_server, server_url):
"""Test the consistency in values between full_type_count and statistics"""
server = restapi_server()
server_thread = Thread(target=server.serve_forever)
_server_url = server_url(port=server.server_port)
try:
server_thread.start()
type_count_response = requests.get(f'{_server_url}/nodes/full_types_count', timeout=10)
statistics_response = requests.get(f'{_server_url}/nodes/statistics', timeout=10)
finally:
server.shutdown()
type_count_dict = linearize_namespace(type_count_response.json()['data'])
statistics_dict = statistics_response.json()['data']['types']
for full_type, count in statistics_dict.items():
if full_type in type_count_dict:
> assert count == type_count_dict[full_type]
E assert 6 == 4