(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func 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 | } |
nothing calls this directly
no test coverage detected