Skip to content

Commit

Permalink
Try actually opening file too
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed Dec 19, 2024
1 parent 32d9ed3 commit ea7ea44
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/osquery/runtime/osqueryinstance_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package runtime

import (
"os"
"strings"
"syscall"
"testing"
Expand Down Expand Up @@ -89,4 +90,11 @@ func createLockFile(t *testing.T, fileToLock string) {
uintptr(unsafe.Pointer(overlapped)),
)
require.False(t, r1 == 0, error(e1))

fh, err := os.Open(fileToLock)
require.NoError(t, err)

t.Cleanup(func() {
fh.Close()
})
}

0 comments on commit ea7ea44

Please sign in to comment.