(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestLockAcquiresWhenFree(t *testing.T) { |
| 104 | lockPath := filepath.Join(t.TempDir(), "free.lock") |
| 105 | |
| 106 | f, unlock, err := flock.Lock(t.Context(), lockPath) |
| 107 | require.NoError(t, err) |
| 108 | require.NotNil(t, f) |
| 109 | unlock() |
| 110 | } |
| 111 | |
| 112 | func TestLockBlocksUntilUnlocked(t *testing.T) { |
| 113 | lockPath := filepath.Join(t.TempDir(), "contended.lock") |