Skip to content

test: coverage gaps, flaky tests, unseeded fuzz, mock overuse, mypy gaps #478

Closed

Description

@Sinity

Problems

Critical coverage gaps

  • operations/archive.py (1012 lines) — zero dedicated test coverage. Only 1 tangential import in test_analytics.py.
  • site/ (17 modules, 2167 lines) — 1 unit test file (test_builder.py, 148 lines, 3 tests). Scan, search, publication_flow, pages, templates all uncovered.
  • rendering/core_messages.py (220 lines) and rendering/core_formatter.py (112 lines) — zero test references.
  • archive_product_rollups.py (126 lines) and facade_ingest.py (81 lines) — zero test references.

Flaky tests

  • tests/unit/storage/test_backend.py:742-802 — 5 concurrency tests rely on asyncio.sleep() for ordering
  • tests/integration/test_ingestion_interrupts.py:177 — time.sleep(1.0) — guaranteed slow
  • Fuzz tests use unseeded random.randint() — non-reproducible failures

Mock overuse

19 "runtime" test files disable mypy strict mode (# mypy: disable-error-code). These mock the entire backend, repository, and operations layer — testing that mocks were called rather than actual behavior. Pattern: with patch(...) as mock: mock.assert_called_once().

Assertion quality

613 terminal assert x is not None across 132 test files — check non-None but inspect no further properties.

Affected code

  • tests/unit/storage/test_backend.py — flaky concurrency
  • tests/integration/test_ingestion_interrupts.py — 1s sleep
  • tests/fuzz/fuzz_*.py — unseeded random
  • 19 _runtime.py test files — mypy-disabled mocks

Discovered during adversarial audit 2026-04-26.

Activity

  1. Sinity commented on Apr 29, 2026

    @Sinity
    OwnerAuthor

    Fixed 22 pre-existing test failures: 3 XPASS (stale xfail removed), 3 provider naming (post-#420), 2 proof-law (post-#498), 2 blob hash validation, 2 path sanitization, snapshot update, argparse subcommand, mock signature, stage sequence, drive path, verify steps, quality registry paths.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions