Work in Progress PR (not ready to be merged) to bump test container to F40.
This includes raising version pinning in pip and align it with the package version shipped in F40 as rpm. Means it addresses a couple of tech debts as well.
I was able to bring the failed tests down to one: FAILED tests/test_pagure_flask_dump_load_ticket.py::PagureFlaskDumpLoadTicketTests::test_dumping_reloading_ticket - Exception: Unable to find object
But even after spending hours, I didn't find a way to fix it. For me it looks like an issue how we test and that the actual pagure code is fine.
This update_ticket_from_git call (https://pagure.io/pagure/blob/master/f/tests/test_pagure_flask_dump_load_ticket.py#_194) fails because it the database return is None (https://pagure.io/pagure/blob/master/f/pagure/lib/tasks.py#_277) and not the latest ticket entry (https://pagure.io/pagure/blob/master/f/pagure/lib/query.py#_3507).
The thing is, when I throw an exception before https://pagure.io/pagure/blob/master/f/pagure/lib/tasks.py#_285 like this:
Then obj is not None and contains the expected database result. If I don't throw the exception, then the if obj is None: hits.
That sounds like some sort of weird concurrency, async whatever issue to me. In https://pagure.io/pagure/blob/master/f/tests/test_pagure_flask_dump_load_ticket.py#_172 we throw away the current db session and recreate everything again. But celery seem to continue to use the global one from before because of the task decorator we add: https://pagure.io/pagure/blob/master/f/pagure/lib/tasks_utils.py#_20
But why there is a result when I throw and exception myself but no of I let it just running, no idea yet.
The unit, or better integration tests, starting celery tasks in always eager mode (https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-always-eager). Another confusing thing because we run a redis instance inside the test container and configure the communication through unix sockets. So for probably historical reasons there are a couple of weird things going on regarding testing our celery tasks in my opinion.
So currently I don't have a idea how to further troubleshoot and address the Unable to find object problem. It also becomes a time problem, I spend way too much of my non existing free time on it already :-/ I pushed the code I have so far and leave the PR open as WIP in case someone else has some ideas and can help out here.
Work in Progress PR (not ready to be merged) to bump test container to F40.
This includes raising version pinning in pip and align it with the package version shipped in F40 as rpm. Means it addresses a couple of tech debts as well.
I was able to bring the failed tests down to one:
FAILED tests/test_pagure_flask_dump_load_ticket.py::PagureFlaskDumpLoadTicketTests::test_dumping_reloading_ticket - Exception: Unable to find objectBut even after spending hours, I didn't find a way to fix it. For me it looks like an issue how we test and that the actual pagure code is fine.
This
update_ticket_from_gitcall (https://pagure.io/pagure/blob/master/f/tests/test_pagure_flask_dump_load_ticket.py#_194) fails because it the database return isNone(https://pagure.io/pagure/blob/master/f/pagure/lib/tasks.py#_277) and not the latest ticket entry (https://pagure.io/pagure/blob/master/f/pagure/lib/query.py#_3507).The thing is, when I throw an exception before https://pagure.io/pagure/blob/master/f/pagure/lib/tasks.py#_285 like this:
Then
objis notNoneand contains the expected database result. If I don't throw the exception, then theif obj is None:hits.That sounds like some sort of weird concurrency, async whatever issue to me. In https://pagure.io/pagure/blob/master/f/tests/test_pagure_flask_dump_load_ticket.py#_172 we throw away the current db session and recreate everything again. But celery seem to continue to use the global one from before because of the task decorator we add: https://pagure.io/pagure/blob/master/f/pagure/lib/tasks_utils.py#_20
But why there is a result when I throw and exception myself but no of I let it just running, no idea yet.
The unit, or better integration tests, starting celery tasks in always eager mode (https://docs.celeryq.dev/en/stable/userguide/configuration.html#task-always-eager). Another confusing thing because we run a redis instance inside the test container and configure the communication through unix sockets. So for probably historical reasons there are a couple of weird things going on regarding testing our celery tasks in my opinion.
So currently I don't have a idea how to further troubleshoot and address the
Unable to find objectproblem. It also becomes a time problem, I spend way too much of my non existing free time on it already :-/ I pushed the code I have so far and leave the PR open as WIP in case someone else has some ideas and can help out here.