fix(cpan-tester): initialize $KILL_AFTER before main execution#574
Merged
fix(cpan-tester): initialize $KILL_AFTER before main execution#574
Conversation
Commit 1ef073e declared `my $KILL_AFTER = 10;` immediately above `sub run_with_timeout` (line 502), but `run_with_timeout` is called from main-line code at line 195 — long before execution reaches the declaration. As a result $KILL_AFTER was undef on every call, producing: Use of uninitialized value $KILL_AFTER in concatenation (.) or string at dev/tools/cpan_random_tester.pl line 509. The resulting command `timeout -k s 300s ...` was rejected by `timeout`, so every module reported `[No parseable output]` and the whole `--count N` run was useless. Move the declaration up next to the other file-scope `my` vars so it's initialized before any call site. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
perl dev/tools/cpan_random_tester.pl --count Nhas been broken since #573 (commit 1ef073e). Every test reported[No parseable output]because$KILL_AFTERwas undef.Root cause
#573 added:
at line ~502, but
run_with_timeoutis invoked from main-line code at line 195 — well before execution reaches line 502 — so the assignment hadn't run yet and$KILL_AFTERwas undef on every call.The script printed:
and the resulting
timeout -k s 300s ...was rejected bytimeout, so jcpan was never actually invoked and every module was scoredFAIL [No parseable output].Fix
Move the
my $KILL_AFTER = 10;declaration up to the other file-scopemydeclarations so it's initialized before any call site.Test plan
perl dev/tools/cpan_random_tester.pl --count 1— no more uninitialized warning, jcpan actually runsmakepassesGenerated with Devin