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

test/e2e: more fixes to not leak tmp files/dirs #22532

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Apr 29, 2024

see commits

Does this PR introduce a user-facing change?

None

Luap99 added 3 commits April 29, 2024 14:16
Using /tmp means this file will be leaked and no deleted, switch to
using the per test tempdir which is removed after the test.

Signed-off-by: Paul Holzinger <[email protected]>
This should use the proper per test tempdir which works just as well for
the purpose.

Signed-off-by: Paul Holzinger <[email protected]>
Because the test left the image mounted the cleanup failed to remove the
tmpdir as it contained an active mount point. Thus ensure we unmount the
image again to prevent this leak.

Signed-off-by: Paul Holzinger <[email protected]>
@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 29, 2024
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

f, err := os.Create(privateFile)
Expect(err).ToNot(HaveOccurred())
// Mark hello to be ignored in outerfile, but it should not be ignored.
_, err = f.WriteString("hello\n")
Expect(err).ToNot(HaveOccurred())
defer f.Close()

// Create .dockerignore which is a symlink to /tmp/private_file.
// Create .dockerignore which is a symlink to /tmp/.../private_file outside of the context dir.
Copy link
Member

Choose a reason for hiding this comment

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

Touching files in cwd is EVIL. Even if my package-e2e PR doesn't merge, I will be insisting on cleaning up this horrible practice:
https://github.com/containers/podman/pull/22395/files#diff-8b4d34c763f953caff8c6747e966aa1a7e869411747cd000370918887ba5b124

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah agreed, I didn't look that closely at the test just the leaked files.
FYI if you wonder where the oom file is created in the cwd when you run all tests see containers/conmon#504

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

LGTM, thank you! One snide comment, but there's no need to fix it in this PR. Just a heads-up.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 29, 2024
Copy link
Contributor

openshift-ci bot commented Apr 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, Luap99

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

@openshift-merge-bot openshift-merge-bot bot merged commit 9eefb5d into containers:main Apr 29, 2024
89 of 91 checks passed
@Luap99 Luap99 deleted the more-e2e-fixes branch April 29, 2024 15:12
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jul 29, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants