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

tracing tests: Mkdir failed: mkdir /tmp2: file exists #238

Closed
kkourt opened this issue Jul 15, 2022 · 1 comment · Fixed by #255
Closed

tracing tests: Mkdir failed: mkdir /tmp2: file exists #238

kkourt opened this issue Jul 15, 2022 · 1 comment · Fixed by #255
Assignees
Labels
area/ci Related to CI

Comments

@kkourt
Copy link
Contributor

kkourt commented Jul 15, 2022

Using the new test option (-disable-tetragon-logs, #237) I'm seeing:

--- PASS: TestKprobeObjectOpen (2.78s)  
=== RUN   TestKprobeObjectOpenMount     
    kprobe_test.go:583: Mkdir failed: mkdir /tmp2: file exists
    kprobe_test.go:584:                 
--- SKIP: TestKprobeObjectOpenMount (0.00s)
=== RUN   TestKprobeObjectMultiValueOpen
    jsonchecker.go:132: jsonTestCheck: opening: /tmp/tetragon.gotest.TestKprobeObjectMultiValueOpen.359677843.json
    filenames.go:60: deleting export file for TestKprobeObjectMultiValueOpen (/tmp/tetragon.gotest.TestKprobeObjectMultiValueOpen.359677843.json)
--- PASS: TestKprobeObjectMultiValueOpen (2.75s)
=== RUN   TestKprobeObjectMultiValueOpenMount
    kprobe_test.go:583: Mkdir failed: mkdir /tmp2: file exists
    kprobe_test.go:584:      

Which points to:

mntPath := "/tmp"
if useMount == true {
mntPath = mountPath
if err := os.Mkdir(mntPath, 0755); err != nil {
t.Logf("Mkdir failed: %s\n", err)
t.Skip()

We should probably fix this since the test is skipped. I think the best option would be to create a temp directory (https://pkg.go.dev/os#MkdirTemp) for each test and remove it afterwards.

@kkourt kkourt added the area/ci Related to CI label Jul 15, 2022
@tpapagian tpapagian self-assigned this Jul 19, 2022
tpapagian added a commit that referenced this issue Jul 21, 2022
FIXES: #238

Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
@jrfastab
Copy link
Contributor

fixed here. 4351d2c

jrfastab pushed a commit that referenced this issue Jul 28, 2022
FIXES: #238

Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci Related to CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants