Skip to content
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

Create local copy to avoid potential race condition #116994

Merged
merged 1 commit into from
May 24, 2023

Conversation

mmiranda96
Copy link
Contributor

What type of PR is this?

Create a local copy of testcase struct.

/sig node
/kind cleanup
/kind flake

What this PR does / why we need it:

When running parallel code inside a loop, it's important to avoid referencing the iterator in the loop condition directly, as it can change and we might end up accessing a different thing. To fix this, the best solution is to create a local copy of the struct.

Which issue(s) this PR fixes:

Fixes #116505

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None, this is a test-only change.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 29, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.27 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.27.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Mar 29 16:30:31 UTC 2023.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/flake Categorizes issue or PR as related to a flaky test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 29, 2023
@k8s-ci-robot k8s-ci-robot added area/kubelet needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 29, 2023
@mmiranda96
Copy link
Contributor Author

/assign UtopiaGithub @SergeyKanzhelev

@k8s-ci-robot
Copy link
Contributor

@mmiranda96: GitHub didn't allow me to assign the following users: UtopiaGithub.

Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/assign UtopiaGithub @SergeyKanzhelev

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mmiranda96
Copy link
Contributor Author

/triage accepted
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 29, 2023
@mmiranda96
Copy link
Contributor Author

@UtopiaGitHub PTAL

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

I vaguely remember there was linter added for this. But cannot find any references to this

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 799cc385ffce54ec88f6d14ccd680fee27f30906

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Needs Approver in SIG Node PR Triage Mar 29, 2023
@Adeccer
Copy link

Adeccer commented Mar 30, 2023 via email

@pacoxu
Copy link
Member

pacoxu commented Mar 30, 2023

/assign @yujuhong
/approve

@SergeyKanzhelev
Copy link
Member

/area test

@SergeyKanzhelev
Copy link
Member

/assign @mrunalp

@mrunalp can you please approve?

@SergeyKanzhelev
Copy link
Member

/assign @mrunalp

Can you pls approve?

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to PRs - Needs Reviewer in SIG Node CI/Test Board May 10, 2023
@SergeyKanzhelev SergeyKanzhelev moved this from PRs - Needs Reviewer to PRs - Needs Approver in SIG Node CI/Test Board May 24, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mmiranda96, mrunalp, pacoxu, SergeyKanzhelev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 24, 2023
@k8s-ci-robot k8s-ci-robot merged commit de12f89 into kubernetes:master May 24, 2023
1 check passed
SIG Node CI/Test Board automation moved this from PRs - Needs Approver to Done May 24, 2023
SIG Node PR Triage automation moved this from Needs Approver to Done May 24, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

systemd: loop variables captured by 'func' literals in 'go' statements
7 participants