AB testing - Ensure test group sizes are rounded down to min resolution if needed#15274
Merged
AB testing - Ensure test group sizes are rounded down to min resolution if needed#15274
Conversation
Jakeii
commented
Feb 2, 2026
| getTestGroupName(group), | ||
| group.audienceSize * MVT_COUNT, | ||
| ); | ||
| } else if (currentTestGroup.length !== group.audienceSize * MVT_COUNT) { |
Member
Author
There was a problem hiding this comment.
This check was also missing, it was calling the resizeTestGroup even if a resize wasn't needed, no issue with this other than unnecessary logging.
Jakeii
commented
Feb 2, 2026
| if (!currentTest) { | ||
| console.log(`Adding new test group: ${test.name}:${test.group}`); | ||
| updateTestGroups.forEach((group) => { | ||
| const currentTestGroup = testGroupMVTs.getTestGroup( |
Member
Author
There was a problem hiding this comment.
renamed these vars, they refer to the test group not the test.
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
on-ye
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Ensure that ab test groups sizes do not exceed the overall test size by rounding non-integer groups down.
Why?
If group sizes are rounded up (or used as is) it could cause the actual mvt usage to exceed that of the test e.g.
A 20% test / 3 groups = 6.66666...7
The minimum actual test resolution is 0.1% if rounded up to 6.7% the actual MVT usage would be 20.1% which could cause issues when calculating if there's enough space for a test.
The lack of rounding also caused an issue on test resize as it tries to update an array to a decimal length, which this also fixes.
I've added a test case for this.