(t *testing.T)
| 775 | } |
| 776 | |
| 777 | func 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 | |
| 791 | func TestStopConfigReloadTimerSafeWhenNil(t *testing.T) { |
| 792 | w := &Watcher{} |
nothing calls this directly
no test coverage detected