sqlinsight-pro/tests
Søren Eggert Lundsteen Olsen 6d8a5d9ad7 Review 1.5: a Windows server that hangs no longer holds up the agent; reads are bounded and backed off
Deadlines
- Event log over RPC (MS-EVEN6): the whole read has a deadline (OperationTimeout per log);
  the token cancels the EventLogSession's operations and is checked before each
  FormatDescription, and the agent stops waiting even if the native call ignores it.
  Reported as ServerAccessProblem.Timeout ("svarede ikke i tide over hændelsesloggens
  protokol (RPC) inden for N sekunder").
- Every CIM call runs on the thread pool and is awaited with the caller's token; a call
  that ignores cancellation is abandoned and the CIM session is closed once it returns.
- Each server cycle has a deadline (new SQLInsight:Servers:CycleTimeout, default 5 min,
  1-30 min, at least 2 x OperationTimeout): the areas not read by then are "ikke målbar"
  ("Serveren svarede ikke inden for N minutter, så indsamlingen blev afbrudt; …"),
  logged once, and the slot is freed.
- Scheduled tasks: run information is read within a time budget (CycleTimeout / 3); the
  rest keep their state without the last run, and the coverage note says so.
- "Test server" has an overall deadline (WindowsServerTester, default 2 min); areas not
  done in time are reported as not answered, so the result is always stored.

Backoff and memory
- A server that does not answer (Unreachable/Timeout, or a timed-out cycle) is backed
  off 1, 2, 5, 10, then 15 minutes, reset when it answers.
- Protocol Auto: the protocol that worked (e.g. DCOM after WS-Man was refused, also for
  access denied) is tried first for an hour, then WS-Man is tried again; a server whose
  event log RPC failed is read over CIM for an hour.
- Over WS-Man with read-only WinRM rights Task Scheduler's GetInfoByName is denied: with
  Auto the tasks are read over DCOM instead (remembered for the server); with WSMan forced
  the reason says to choose Auto or DCOM. The advice "winrm configSDDL default" (broader
  WinRM rights) is gone; texts follow the grant script (-WinRM read right,
  -EnableFirewall -AgentAddress), not Remote Management Users.

Events
- Each log continues from its own mark (ServerEventSnapshot.LogReadUntil, a small additive
  field in Core): a truncated System log no longer loses the events between its last
  read event and the newest Application event.
- CIM fallback: Win32_NTLogEvent is streamed and only the oldest max per log are kept
  (memory bounded, deterministic order), consistent with the RPC read and the coverage
  text, which now names the logs that had more.

Other
- CimInstances (and method results) are mapped to SQLInsight's types and disposed at once.
- Options are clamped when bound (ServerOptions/SyntheticCheckOptions.Normalize):
  OperationTimeout 5 s-5 min, MaxEventsPerCollection 10-10000, MaxWatched 1-200,
  MaxParallelServers/Checks 1-32, retention days >= 1, ForecastHistoryDays 1-365,
  FailuresBeforeFinding/SlowRunsBeforeFinding 1-99.
- Shutdown: the timer's cancellation is caught, running cycles are awaited before the
  throttle is disposed; a cycle's time is taken when it gets its slot; a TaskCanceledException
  that is not shutdown no longer ends the service.
- Retention maintenance also runs (hourly) when SQLInsight:Servers:Enabled is false but
  synthetic checks are on.
- LocalCimTests run alone (collection without parallelization), share one warmed-up
  session, use the same 2 min operation timeout and a 5 min deadline per test, a smaller
  workload, and report timings in assertion messages.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 16:02:17 +02:00
..
SQLInsight.Agent.Tests Review 1.5: a Windows server that hangs no longer holds up the agent; reads are bounded and backed off 2026-10-02 16:02:17 +02:00
SQLInsight.Collectors.Tests Review 1.5: SQL Scripts for Windows servers and synthetic checks follow main's structure and registry 2026-10-02 15:18:24 +02:00
SQLInsight.Community.Tests Docs: Windows-servere og syntetiske tjek (1.5) 2026-10-02 14:59:22 +02:00
SQLInsight.Connectivity.Tests Fase 2: Azure SQL Managed Instance, docs and rule catalog test 2026-09-29 08:23:40 +00:00
SQLInsight.Core.Tests Review 1.5: a check sent back from API v1 with [udeladt] login or URL query is refused, not saved 2026-10-02 15:54:38 +02:00
SQLInsight.IntegrationTests Review 1.5: a Windows server that hangs no longer holds up the agent; reads are bounded and backed off 2026-10-02 16:02:17 +02:00
SQLInsight.Licensing.Tests Ship SEOSoft's license key k20261001; agent defaults to the real hub 2026-10-01 07:15:47 +02:00
SQLInsight.Notifications.Tests Fase 4: integration with Prometheus, Grafana, SCOM and scripts 2026-09-29 09:56:01 +00:00
SQLInsight.Rules.Tests Review 1.5: server and check rules never pass unmeasured, cap and stabilize findings, keep sensitive text out of titles 2026-10-02 15:45:44 +02:00
SQLInsight.Servers.Tests Review 1.5: a Windows server that hangs no longer holds up the agent; reads are bounded and backed off 2026-10-02 16:02:17 +02:00
SQLInsight.Updates.Tests Community-websted og Discourse-forum 2026-09-29 13:45:06 +00:00