diff options
Diffstat (limited to 'internal/lsp/debounce_throttle_more_test.go')
| -rw-r--r-- | internal/lsp/debounce_throttle_more_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/lsp/debounce_throttle_more_test.go b/internal/lsp/debounce_throttle_more_test.go index 22d1888..a3c4b11 100644 --- a/internal/lsp/debounce_throttle_more_test.go +++ b/internal/lsp/debounce_throttle_more_test.go @@ -11,11 +11,9 @@ func TestWaitForDebounce_WaitsRoughlyDebounce(t *testing.T) { cfg := s.cfg cfg.CompletionDebounceMs = 20 s.cfg = cfg - s.mu.Lock() - s.lastInput = time.Now() - s.mu.Unlock() + s.chatSvc().markActivity() start := time.Now() - s.waitForDebounce(context.Background()) + s.completionSvc().waitForDebounce(context.Background()) if elapsed := time.Since(start); elapsed < 15*time.Millisecond { t.Fatalf("debounce did not wait long enough: %v", elapsed) } @@ -26,9 +24,10 @@ func TestWaitForThrottle_WaitsRoughlyInterval(t *testing.T) { cfg := s.cfg cfg.CompletionThrottleMs = 20 s.cfg = cfg - s.stateMu.Lock() - s.lastLLMCall = time.Now() - s.stateMu.Unlock() + cs := s.completionSvc() + cs.stateMu.Lock() + cs.lastLLMCall = time.Now() + cs.stateMu.Unlock() start := time.Now() if !s.waitForThrottle(context.Background()) { t.Fatalf("waitForThrottle returned false") |
