Skip to content

Fix persistence issue in test_app_id_special_chars#1056

Open
mastastny wants to merge 1 commit into
3scale-qe:mainfrom
mastastny:fix-load-store-chars
Open

Fix persistence issue in test_app_id_special_chars#1056
mastastny wants to merge 1 commit into
3scale-qe:mainfrom
mastastny:fix-load-store-chars

Conversation

@mastastny

@mastastny mastastny commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Split shared service into two (headers and query) so credentials_location is not mutated between parametrized tests. Fixes 403 on persistence load when headers test runs after query test overwrote the setting.

reproducer:
pipenv run python -m pytest -m 'not flaky' --fuzz --drop-nopersistence --store x testsuite/tests/fuzz/test_app_id_special_chars.py
pipenv run python -m pytest -m 'not flaky' --fuzz --drop-nopersistence --load x testsuite/tests/fuzz/test_app_id_special_chars.py

Split shared service into two (headers and query) so credentials_location is not mutated between parametrized tests. Fixes 403 on persistence load when headers test runs after query test overwrote the setting.
@mdujava

mdujava commented Jul 10, 2026

Copy link
Copy Markdown
Member

can't we put service_1 if _ else service_2 into the @pytest.parametrize?

@mdujava mdujava added the to_backport Commits to be backported to stable branches label Jul 10, 2026
@mastastny

Copy link
Copy Markdown
Collaborator Author

can't we put service_1 if _ else service_2 into the @pytest.parametrize?

I don't think so. Parametrize values are resolved at collection time, before fixtures are instantiated, so we can't reference fixture objects there. But I might be missing something, do you have a specific approach in mind?

pytest.param(
"!#$&'(h",
"keykey2",
"headers",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there is "headers" why not put here header_service fixture directly (query_fixture instead of "query"), similar how we in some tests use either prod_client or api_client.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, but credentials_location is also used in the assertion (line 236) to decide whether to check headers or params, so we'd still need it as a value, not just a fixture reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

to_backport Commits to be backported to stable branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants