Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
dannykopping merged 2 commits intocoder:mainfromdannykopping:dk/test-race
Mar 13, 2024

Conversation

dannykopping
Copy link
Contributor

Signed-off-by: Danny Kopping <danny@coder.com>
@dannykoppingdannykopping changed the titlefix: data race in TestLabelsAggregation testsfix: fix data race in TestLabelsAggregation testsMar 13, 2024
Comment on lines 208 to 214
var expectedLabels []*agentproto.Stats_Metric_Label
for _, l := range e.Labels {
expectedLabels = append(expectedLabels, &agentproto.Stats_Metric_Label{
Name: l.Name,
Value: l.Value,
})
}
Copy link
Member

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)?

https://go.dev/wiki/SliceTricks#copy

Copy link
ContributorAuthor

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>
@dannykoppingdannykopping merged commitda54c8a intocoder:mainMar 13, 2024
@dannykoppingdannykopping deleted the dk/test-race branchMarch 13, 2024 11:47
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 13, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@dannykopping@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp