(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestLockReturnsNonContentionError(t *testing.T) { |
| 142 | lockPath := filepath.Join(t.TempDir(), "no", "such", "dir", "test.lock") |
| 143 | |
| 144 | _, _, err := flock.Lock(t.Context(), lockPath) |
| 145 | require.ErrorIs(t, err, os.ErrNotExist) |
| 146 | } |
| 147 | |
| 148 | func TestLockTimesOutUnderContention(t *testing.T) { |
| 149 | lockPath := filepath.Join(t.TempDir(), "held.lock") |