Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use factory.Sequence with faker.unique to remove the chance of duplicate values #17740

Merged
merged 4 commits into from
Mar 24, 2025

Conversation

cofiem
Copy link
Contributor

@cofiem cofiem commented Mar 10, 2025

Replace faker providers known to occasionally fail with the unique faker (safe_email, user_name, ipv4_private

Based on: FactoryBoy/factory_boy#305
See also: FactoryBoy/factory_boy#820

closes #17734
relates to #15398

Replace faker providers known to occasionally fail with the unique faker (safe_email, user_name, ipv4_private

Based on: FactoryBoy/factory_boy#305
See also: FactoryBoy/factory_boy#820

closes pypi#17734
relates to pypi#15398
@cofiem cofiem requested a review from a team as a code owner March 10, 2025 11:16
@cofiem
Copy link
Contributor Author

cofiem commented Mar 10, 2025

Of the 4 randomly seeds from #15398 that failed for me, this change seems to fix 3 of them.

  • make tests TESTARGS="--randomly-seed=1697538841 -vvv" T=tests/unit/admin/views/test_emails.py::TestEmailList
  • make tests TESTARGS="--randomly-seed=2228510538 -vvv" T=tests/unit/admin/views/test_ipaddresses.py::TestIpAddressList
  • make tests TESTARGS="--randomly-seed=1862154588 -vvv" T=tests/unit/admin/views/test_prohibited_user_names.py::TestProhibitedUserNameList

This one still fails:

  • make tests TESTARGS="--randomly-seed=816117609 -vvv" T=tests/unit/packaging/test_tasks.py::TestUpdateBigQueryMetadata

@miketheman miketheman added the testing Test infrastructure and individual tests label Mar 10, 2025
@cofiem cofiem requested a review from miketheman March 22, 2025 08:45
@cofiem cofiem changed the title Use a unique faker class to remove the chance of duplicate values Use Use factory.Sequence with faker.unique to remove the chance of duplicate values Mar 22, 2025
@cofiem cofiem changed the title Use Use factory.Sequence with faker.unique to remove the chance of duplicate values Use factory.Sequence with faker.unique to remove the chance of duplicate values Mar 22, 2025
@di di enabled auto-merge (squash) March 24, 2025 16:15
@di di merged commit 2f5f487 into pypi:main Mar 24, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Test infrastructure and individual tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stateful test failure using randomly seed 1697538841 looks like a faker issue
3 participants