v0.2.2 fixes: split only text sources, report a mode change once, don't block on open
Test / test (push) Canceled after 0s

This commit is contained in:
lixen committed 2026-10-03 23:47:22 -04:00
1 parent 2a47be454d
commit 4d3c91406b
21 files changed
+368 -62

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
//go:build unix
package config
import (
"path/filepath"
"syscall"
"testing"
"time"
)
// The open cannot block: a FIFO swapped in after the Stat fails at once
func TestOpenConfigNeverBlocks(t *testing.T) {
fifo := filepath.Join(t.TempDir(), "config.toml")
if err := syscall.Mkfifo(fifo, 0600); err != nil {
t.Skip(err)
}
done := make(chan struct{})
go func() {
if f, err := openConfig(fifo); err == nil {
f.Close()
}
close(done)
}()
select {
case <-done:
case <-time.After(2 * time.Second):
t.Fatal("open blocked on a FIFO without a writer")
}
}