Fix cleanup_old_versions! misbehaviour#661
Merged
andrehjr merged 2 commits intosplitrb:mainfrom Jul 19, 2021
Merged
Conversation
Contributor
Author
|
@andrehjr what do you think? Does this make sense or I need to provide some more explanation? |
Member
|
Thanks for the PR @serggl I'm taking a look :) Seems odd that the CI didn't trigger the build.. I'm seeing what happened. Maybe I'll move to GH Actions. Although, when running the build locally 3 specs broke. |
Contributor
Author
|
@andrehjr spec failures are now fixed (I wasn't assuming that versioned experiments could have no version numbers in their keys...) |
Member
|
Thanks for the Pull Request! 🙌 this bug was around for a while! Indeed, the 'first' version of an experiment, does not have a version number on the key. |
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.
The problem
I've found that
Split::User#cleanup_old_versions!method misbehaves when you have multiple running experiments with some common strings in their names.For example if you have running both
some_testandsome_test_variation(or evenvariation_of_some_test), then callingcleanup_old_versions!for the first experiment will also drop data for the latter one.The outcome of this behaviour looks very confusing.
In my case I see participant numbers increase on each page refresh for the second and further tests running in the user session, despite the counter must be unique
The solution
Don't use regular expression to match experiment names.
Experiment version keys should be compared from their start and until the colon symbol (
some_test:42is the example of what is actually stored within persistence adapter)