Skip to content

Ignore loaded tags that only contain the desired tag - #492

Open
dajiaohuang wants to merge 1 commit into
bencheeorg:mainfrom
dajiaohuang:fix/491-tag-increaser
Open

dajiaohuang wants to merge 1 commit into
bencheeorg:mainfrom
dajiaohuang:fix/491-tag-increaser

Conversation

@dajiaohuang

Copy link
Copy Markdown

get_maximum_tag_increaser/2 strips the desired tag from every loaded tag that contains it and parses the rest with String.to_integer/1. That remainder is only a number for tags of the form foo or foo-N, so any other loaded tag containing the desired tag - foobar, foo-baseline - raised an ArgumentError and nothing was saved.

Those tags are no increments of the desired tag, so they are ignored now and the next free increment is used, which is foo-1 when none of the loaded tags are an increment of foo.

Verified with mix test test/benchee/formatters/tagged_save_test.exs - the new test raises :erlang.binary_to_integer("baseline") on the unpatched code - plus mix format --check-formatted, mix credo and mix dialyzer. The full suite only fails the memory sample size assertion in runner_test.exs:500, which also fails on an unmodified checkout in this environment.

Fixes #491

get_maximum_tag_increaser/2 stripped the desired tag from every loaded tag
containing it and parsed the remainder as an integer, which raised for tags
like "foo-baseline". Those are no increments of the desired tag, so they are
ignored and the next free increment is used instead.
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.

Saving with a tag that is contained in a loaded tag raises ArgumentError

1 participant