sync: migrate ai-operator to Gitea (2026-08-10)

This commit is contained in:
konturai-ops
2026-08-10 15:26:52 +00:00
commit 53652b95ad
173 changed files with 16676 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package ari
import (
"path/filepath"
"testing"
)
func TestLockFile(t *testing.T) {
path := filepath.Join(t.TempDir(), "listener.lock")
first, err := AcquireLock(path)
if err != nil {
t.Fatal(err)
}
if second, err := AcquireLock(path); err == nil {
_ = second.Release()
t.Fatal("second lock should fail")
}
if err := first.Release(); err != nil {
t.Fatal(err)
}
third, err := AcquireLock(path)
if err != nil {
t.Fatal(err)
}
_ = third.Release()
}