#2293 Frontend tests are failing on F37/Rawhide
Closed: Fixed 3 years ago by praiskup. Opened 3 years ago by frostyx.

Tests for copr-frontend package are failing on F37/Rawhide.

I think it is caused by the python3-flask upgrade from

python3-flask-2.0.3-1.fc36.noarch

to

python3-flask-2.2.2-1.fc37.noarch

I think this upstream issue might be related
https://github.com/pallets/flask/issues/4734

I also think that in our case, the issue is related to the TransactionDecorator.
As an experiment, I tried

./run_tests.sh --no-cov -s -k test_copr_user_can_add_distgit_package

Which is one of the failing tests. Then I removed the @TransactionDecorator("u1") from it and replaced each

self.test_client.post(endpoint, data=data, follow_redirects=True)

with the following block

user = self.u1
self.transaction_user = user
self.transaction_username = user.username
with app.test_client() as test_client:
    with test_client.session_transaction() as session:
        session["openid"] = user.username
response = test_client.post(endpoint, data=data, follow_redirects=True)

And the test is now passing. I think the trick is in creating app.test_client() for every request instead of one for each test method.


Log in to comment on this ticket.

Metadata
Related Pull Requests
  • #2298 Merged 3 years ago