Skip to content

modified-block-currency self-gate flakes across midnight UTC: its two report renderings take the runner's per-invocation --as-of default instead of sharing one date #613

Closed

Description

@brettheap

The defect

tests/doc-health/test_modified_block_currency_self_gate.py::test_the_report_moves_only_in_this_family_s_lines renders the doc-health report of the checkout TWICE (with and without --skip-family modified-block-currency) and asserts every section outside three permitted ones is byte-identical. Its _report() helper (:1412-1434 at c0270d28) builds the command

scripts/doc-health.py --single-repo <root> --report-out <out> [--skip-family modified-block-currency]

and passes NO aging reference date. The runner's --as-of flag (scripts/doc_health/runner.py:264-266) defaults to datetime.now(timezone.utc).date() at each invocation:

ap.add_argument("--as-of",
                default=datetime.now(timezone.utc).date().isoformat(),
                help="aging reference date (YYYY-MM-DD; default: today UTC)")

Each rendering takes roughly two and a half minutes. A run that straddles midnight UTC therefore gives the two renderings two different --as-of dates, the staged-candidate-aging section legitimately ages by a day between them, and the byte-identity assertion fails on a section the family under test never touched.

The test already guards ONE date dependency — _sections drops the dated report title and a guard asserts the title was there to drop — but the aging reference date is a second one it missed.

Evidence

Both PRs were docs-only or touched no doc-health code, and CI on main has never shown it — it can only fire in the roughly five minutes around 00:00Z.

Fix

Compute the reference date once in the test and pass --as-of <date> to BOTH renderings in _report(), so the two reports share one clock by construction rather than by luck. Nine sibling files under tests/doc-health/ already pass an as-of date (grep -l "as-of\|as_of" tests/doc-health/*.py), so this follows house precedent. While there, check the other double-rendering comparisons in that directory for the same omission.

No product code changes; the runner's default is right for operators.

Provenance

Found 2026-09-03 by lane openxfactory-smalls while driving PRs #599 and #604 through CI. Confirmed unfiled before opening.

Lane: openxfactory-smalls

Activity

  1. brettheap commented on Sep 3, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openxfactory-smalls, session 019SkomVcCsRnrwizM9DYUny, 2026-09-03T12:56Z, for the test fix (pass one shared --as-of to both renderings in _report(); sweep the sibling double-render comparisons). No PR or branch exists for it. Stale after 4h with no PR.

    Lane: openxfactory-smalls

  2. added
    bug
    on Sep 3, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions