Skip to content

Make seedless test deterministic#64

Merged
gygAlexWeiss merged 3 commits intomainfrom
make-seedless-test-deterministic
Jan 27, 2025
Merged

Make seedless test deterministic#64
gygAlexWeiss merged 3 commits intomainfrom
make-seedless-test-deterministic

Conversation

@oliviagyg
Copy link
Collaborator

@oliviagyg oliviagyg commented Jan 27, 2025

We hit a rare issue in the CI run here -- one test, test_seed_not_provided, failed. This didn't have anything to do with the commit, though -- instead, it's an issue with the test. We call evaluate_experiment with a small number of samples and -1 overall successes, and this leads to us doing the 'coin flip' to check whether this test experiment might have 'crossed the line'. In this case there's a small (~1%) chance for us to 'fail' the coin flip and get a different result than we normally expect in the test, and that's what happened here.

We avoid this in other tests by setting the seed, but this is the one test where we deliberately don't do that and test the behaviour. So, the fix is to make the test deterministic in other ways. This PR helps us bypass the coin flip by making sure the probability is zero in our first call (by logging no samples at all) and then all the required samples at once in the second call.

@oliviagyg oliviagyg requested review from a team and gygAlexWeiss as code owners January 27, 2025 11:11
Copy link
Collaborator

@gygAlexWeiss gygAlexWeiss left a comment

Choose a reason for hiding this comment

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

Took me a moment to understand what you're doing here. Understood. Looks good.

@gygAlexWeiss gygAlexWeiss merged commit 88a4fe8 into main Jan 27, 2025
3 checks passed
@gygAlexWeiss gygAlexWeiss deleted the make-seedless-test-deterministic branch January 27, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants