Skip to content

test: make fh-ref-leak.t green with TODO guards for unfixed OFC - #422

Draft
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/fix-fh-ref-leak-todo
Draft

test: make fh-ref-leak.t green with TODO guards for unfixed OFC#422
toddr-bot wants to merge 1 commit into
cpan-authors:mainfrom
toddr-bot:koan.toddr.bot/fix-fh-ref-leak-todo

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

Make t/fh-ref-leak.t pass on main by wrapping three assertions in conditional TODO guards.

Why

The test validates GH #179 (filehandle reference leak via Overload::FileCheck's $_last_call_for cache). The expected behavior is correct, but the upstream fix (OFC PR #25) hasn't shipped. Without TODO guards, the test suite reports 3 failures on every run — noise that hides real regressions.

How

A runtime probe at load time checks whether OFC still retains refs. When it does, Test2 todo guard objects wrap the three affected assertions. Once OFC ships the fix, the probe detects it and the assertions auto-promote to hard pass/fail — no code change needed.

Testing

  • prove -l t/fh-ref-leak.t — 4/4 pass (3 as TODO)
  • Full suite: 94 files, 1586 tests, all pass

Quality Report

Changes: 1 file changed, 33 insertions(+), 3 deletions(-)

Code scan: 1 issue(s) found

  • t/fh-ref-leak.t:27 — TODO comment

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan

Overload::FileCheck retains filehandle refs in its internal
$_last_call_for cache (GH cpan-authors#179, OFC PR cpan-authors#25). The test correctly
validates the expected behavior but was failing on main because
the upstream fix hasn't shipped yet.

Add a runtime probe that detects whether the fix is present and
wraps the three affected assertions in Test2 todo guards when it
is not. Tests auto-promote to hard assertions once OFC ships the fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant