Skip to content

test(markdown-format): port differential C1 fd1-leak detector from desktop-notification #1209

Closed

Description

@kyle-sexton

Summary

The markdown-format hook contract test's C1 fd1-inheritance-leak detector
(plugins/markdown-format/hooks/markdown-format.test.sh) asserts the slow-sink
run returns in under a fixed 2000ms wall-clock bound against a 3s sink sleep.
That fixed bound sits inside the machine- and load-dependent spawn-overhead band
— on Windows Git Bash a single hook invocation is already ~1.5s, and parallel
test suites push it higher — so the assertion can false-fail with no fd1 leak
present
.

The sibling desktop-notification plugin already carries the matured form of the
same detector (Case 13): it measures the slow-sink cost differentially — a
baseline (fast sink, minimum of several runs) subtracted from the slow-sink run —
which cancels the shared ambient overhead and isolates the leak signal. Under a
leak the delta is ~SINK_SLEEP; with no leak it is ~0 ± jitter; the threshold is
half the sleep.

Port that differential idiom into markdown-format's C1 test so it stays
reliable under load, matching the reviewed desktop-notification version.

Test plan

  • bash plugins/markdown-format/hooks/markdown-format.test.sh stays green (65/65).
  • Delta under normal conditions is well below the half-sleep threshold
    (observed 16–108ms vs a 3000ms threshold on Windows Git Bash).
  • No temp-dir leak or cleanup stderr from the 6s background sink (it completes
    before the suite's EXIT trap, which has ample post-C1 work).
  • shellcheck clean; changelog-parity --check-bump green (patch bump + entry).

Related

Follow-up from a prior session's handoff list: "markdown-format C1 differential
test port". No behavior change to the plugin hook itself — test-infrastructure
hardening only.

Activity

  1. added
    needs-triage
    on Jul 24, 2026
  2. added 2 commits that reference this issue on Jul 24, 2026
    dcd9825
    3d39c33
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

    needs-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions