Skip to content

per-host-throttle sequential-mode test fails under load (expected >= 30 ms) #1521

Closed as not planned

Description

@nc9

apps/cli/tests/crawler/per-host-throttle.test.ts "sequential mode (perHostConcurrency=1) still spaces starts by the delay" is timing-sensitive and fails on a loaded CI runner. It measures Date.now() deltas between the starts of five fetches and requires each gap to be at least DELAY * 0.6 (30 ms for a 50 ms delay). On a busy runner the timer fires early or the clock reads round, and a gap of 27 ms was observed: Expected: >= 30. The crawler behaves correctly; the assertion is too tight for a wall-clock measurement on a shared machine.

Seen once on a draft PR's CLI tests job (the PR changed nothing in the crawler). It reddens a PR check for no product reason.

Acceptance Criteria

  • The test no longer depends on a wall-clock gap of at least 30 ms: it either uses a fake or injectable clock, or asserts a tolerance that load cannot break (for example at least 40 percent of the delay, or the ordering of starts plus a total elapsed time over the sum of the delays).
  • The test still fails if the single slot collapses to back-to-back fetches (gaps near zero): a mutation that removes the per-host delay makes it fail.
  • 50 consecutive runs of the file with the machine under load (for example a parallel CPU burn) pass.

nik

Activity

  1. added
    bug
    size: XS
    on Nov 1, 2026
  2. added theissue type on Nov 1, 2026
  3. nc9 commented on Nov 2, 2026

    @nc9
    ContributorAuthor

    Duplicate of #1516. The fix landed in v0.0.158 as d200773 and f4a8e93 (via #1522): the sequential-mode test asserts the median of the start gaps and the total span, each with a margin of more than 2x. An independent check ran the file 8 of 8 times with 6 busy processes alongside. Closing as a duplicate. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcisize: XS

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions