Skip to content

Tests and comments: four small fixes left from #4945 and #4946 #4956

Closed

Description

@erikdarlingdata

Four small fixes found while checking #4945 and #4946. None of them changes what the apps do.

The server page Range census

Files: Darling/Darling.Tests/web-kept-history-harness.mjs and Darling/Darling.Tests/WebServerPageRangeTests.cs.

  1. A read recorded at the very end is never checked.
    • The offeredRanges scenario checks each tab's fetches right after that tab's settleFast().
    • A fetch recorded after the last tab's settleFast() lands during the harness's final settle(). It reaches fetches but never beyond. So a slow read that asks for too many hours does not fail the test.
    • Fix: after the final settle(), check the whole fetches list. Any read asked for more than McpHelpers.MaxHoursBack hours fails the test, even when it cannot be tied to a tab.
    • Prove it: plant a deferred read on the last tab and watch the test fail.
  2. The census cannot see notices or errors.
    • offeredRanges returns no nodes, so nothing is mounted. Its notices and errors are always empty.
    • Only a manual browser check shows that no panel shows the asked-again notice or an error at an offered range.
    • Fix: mount what the scenario builds. Fail on any notice or error at an offered range, the way the census scenario already fails on errors.
    • Prove it: make one read refuse 168 hours and watch the test fail on its notice.

Two MCP comments that claim too much

  1. Darling/Darling.Tests/McpWholeNumberArgumentTests.cs:49 says the inert data source is never opened, because every call is refused before the tool body.
    • That holds for this class. But two tests in McpUnknownArgumentGuardTests share the same host and do reach the tool body.
    • The one-second connect timeout on a closed port is what keeps them fast.
    • Fix: say so in the comment.
  2. PerformanceMonitor.Common/Mcp/McpHelpers.cs:90 says a 512,000-unit limit costs no more than a 40-unit one.
    • That holds only when the text is ASCII at the cut.
    • When the text around the limit is not ASCII, the cut walks back to the start. Then it segments forward. So the cost grows with the limit, as the old copy did.
    • Fix: say that the claim applies to the ASCII case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions