-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TraceQL results caching bug for floats ending in .0 #4539
Fix TraceQL results caching bug for floats ending in .0 #4539
Conversation
4444827
to
60eb3c6
Compare
@@ -352,7 +352,7 @@ func TestQuantileOverTime(t *testing.T) { | |||
// Output series with quantiles per foo | |||
// Prom labels are sorted alphabetically, traceql labels maintain original order. | |||
out := SeriesSet{ | |||
`{p="0", span.foo="bar"}`: TimeSeries{ | |||
`{p="0.0", span.foo="bar"}`: TimeSeries{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is wanted @mdisibio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting side effect. It's ok. The actual label value is the same NewStaticFloat(0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a few more test cases to be 100% of all effects, and then lgtm.
@@ -352,7 +352,7 @@ func TestQuantileOverTime(t *testing.T) { | |||
// Output series with quantiles per foo | |||
// Prom labels are sorted alphabetically, traceql labels maintain original order. | |||
out := SeriesSet{ | |||
`{p="0", span.foo="bar"}`: TimeSeries{ | |||
`{p="0.0", span.foo="bar"}`: TimeSeries{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting side effect. It's ok. The actual label value is the same NewStaticFloat(0)
{arg: 10.0, want: "10"}, | ||
{arg: -1.0, want: "-1.0"}, | ||
{arg: 0.0, want: "0.0"}, | ||
{arg: 10.0, want: "10.0"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a few more cases: not ending in .0, and something with the e
scientific notation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry my comment wasn't clear. The cases I meant were a value like 12.34
to test the .
, and something huge that outputs the e
to test that case. 12.34 is halfway covered by the second case, but let's get clear cases where input == output. The 0
case isn't needed cause that's testing the int path which is already covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the 2 test cases and another one I think wasn't covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
12.34e+2
Nice catch 👍
26ff094
to
4bf18b9
Compare
4bf18b9
to
9def255
Compare
What this PR does:
Which issue(s) this PR fixes:
Fixes #4528
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]