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

Starting multiple test environments can fail due to multiple trying to delete the same port file #1909

Closed
jcanseco opened this issue May 18, 2022 · 0 comments · Fixed by #1910

Comments

@jcanseco
Copy link
Contributor

jcanseco commented May 18, 2022

Background

Problem

  • The same logic used to create files to reserve ports also has logic that deletes files corresponding to "outdated" ports.

  • Therefore, if one were to start multiple test environments in parallel (e.g. in different processes or threads), then some may fail to start since they may end up trying to delete the same file that others have already deleted.

  • In particular, they may fail to start due to the following error:

    unable to start control plane itself: failed to start the controlplane. retried 5 times: lstat /usr/local/home/jcanseco/.cache/kubebuilder-envtest/./port-42369: no such file or directory
    

    ...which comes from this line.

    unable to start control plane itself: failed to start the controlplane. retried 5 times: remove /usr/local/home/jcanseco/.cache/kubebuilder-envtest/port-36781: no such file or directory
    

    ...which comes from this line.

Potential Solution

I have verified that this can be fixed by adding logic along the lines of "don't error out if trying to delete a file that no longer exists".

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 a pull request may close this issue.

1 participant