MCPcopy
hub / github.com/docker/docker-agent / TestFileLockHelperProcess

Function TestFileLockHelperProcess

pkg/memory/database/lock_test.go:57–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestFileLockHelperProcess(t *testing.T) {
58 if os.Getenv("MEMORY_LOCK_HELPER") != "1" {
59 return
60 }
61 args := os.Args
62 for i, arg := range args {
63 if arg == "--" && i+1 < len(args) {
64 lock := NewFileLock(args[i+1])
65 if err := lock.Lock(t.Context()); err != nil {
66 os.Exit(2)
67 }
68 if err := lock.Unlock(); err != nil {
69 os.Exit(3)
70 }
71 os.Exit(0)
72 }
73 }
74 os.Exit(4)
75}

Callers

nothing calls this directly

Calls 4

LockMethod · 0.95
UnlockMethod · 0.95
NewFileLockFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected