MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / TestPersistAsyncErrorPaths

Function TestPersistAsyncErrorPaths

internal/watcher/watcher_test.go:777–789  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

775}
776
777func TestPersistAsyncErrorPaths(t *testing.T) {
778 p := &errorPersister{}
779 w := &Watcher{storePersister: p}
780 w.persistConfigAsync()
781 w.persistAuthAsync("msg", "a")
782 time.Sleep(30 * time.Millisecond)
783 if atomic.LoadInt32(&p.configCalls) != 1 {
784 t.Fatalf("expected PersistConfig to be called once, got %d", p.configCalls)
785 }
786 if atomic.LoadInt32(&p.authCalls) != 1 {
787 t.Fatalf("expected PersistAuthFiles to be called once, got %d", p.authCalls)
788 }
789}
790
791func TestStopConfigReloadTimerSafeWhenNil(t *testing.T) {
792 w := &Watcher{}

Callers

nothing calls this directly

Calls 2

persistConfigAsyncMethod · 0.95
persistAuthAsyncMethod · 0.95

Tested by

no test coverage detected