Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: Fix for spurious test failures. #410

Merged
merged 1 commit into from
Jan 13, 2025
Merged

fix: Fix for spurious test failures. #410

merged 1 commit into from
Jan 13, 2025

Conversation

jgadling
Copy link
Contributor

@jgadling jgadling commented Jan 11, 2025

We've been seeing intermittent apiv2 test failures in our pull requests.

We use a test fixture library called factory_boy to generate semi-randomized database rows in our tests. This tool works great, when it's configured properly! However we were generating object ID's like so:

id = fuzzy.FuzzyInteger(1, 1000)

This tells the test fixture to use a random number between 1 and 1000 for each object ID. Our tests were failing sporadically because sometimes when we told the fixture to make a batch of N rows, some of those rows would get generated with the same identifier, and get collapsed into a single row!

This PR updates the fixture configuration to use factory_boy's Sequences functionality to generate sequential ID's instead of random ID's, and should hopefully 🤞 make our tests more reliable.

@jgadling jgadling merged commit fedd776 into main Jan 13, 2025
6 checks passed
@jgadling jgadling deleted the jgadling/fix-tests branch January 13, 2025 21:20
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants