fix: HandleQueue gracefully handles missing qfile configuration#12
Draft
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Draft
fix: HandleQueue gracefully handles missing qfile configuration#12Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:mainfrom
Conversation
When the smoker is started without qfile configured, HandleQueue->new() would unconditionally pass qfile=>undef to PostQueue->new(), which validates the attribute and dies with a confusing internal error. Guard PostQueue creation behind a defined-check on qfile so that HandleQueue is a no-op when the queue feature is not configured. Fixes Perl-Toolchain-Gang#11 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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
When the smoker is started without
qfileconfigured,HandleQueue->new()unconditionally passedqfile => undeftoPostQueue->new(), which validates the attribute and dies with a confusing internal error:Test::Smoke::PostQueue must have qfile as defined attribute in new()!.The generated smoke script already guards against invoking
tshandlequeue.plwhen qfile is unconfigured, but this crash could still occur if the script is run directly or from an older generated script.Fixes #11
Changes
HandleQueue->new(): Only create thePostQueueandPosterobjects whenqfileis definedHandleQueue->run(): Return early (no-op) when_queuewas not initializedt/app/170-handlequeue.t: Add test covering the no-qfile case (must run before the singleton is created)Test plan
t/app/170-handlequeue.treproduces the crash: createsHandleQueuewithout--qfileand asserts no exception is thrownt/app/170-handlequeue.ttests continue to passt/postqueue.tandt/poster-post.tunaffectedGenerated by Kōan /fix
Quality Report
Changes: 2 files changed, 39 insertions(+), 14 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline