- Notifications
You must be signed in to change notification settings - Fork928
fix: fix data race in TestLabelsAggregation tests#12578
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Signed-off-by: Danny Kopping <danny@coder.com>
var expectedLabels []*agentproto.Stats_Metric_Label | ||
for _, l := range e.Labels { | ||
expectedLabels = append(expectedLabels, &agentproto.Stats_Metric_Label{ | ||
Name: l.Name, | ||
Value: l.Value, | ||
}) | ||
} |
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.
Why notcopy(expectedLabels, e.Labels)
?
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.
Good call! I tried it before but it wasn't working, but now I realise I needed to size the dst slice first 🤦
Fixed in9113c015e
Signed-off-by: Danny Kopping <danny@coder.com>
Seen here:https://github.com/coder/coder/actions/runs/8262787141/job/22602878845