fix(tests): tmpfile-cleanup assertion matched a call site that no lon… - #5000
Open
AniketBajaj2024 wants to merge 1 commit into
Open
Conversation
…ger holds the tmpfile Test 8 asserted 'rm -f $tmpfile' appeared within 2 lines before error "Docker installation failed". The download and its cleanup were since moved into _docker_install_from_script(), so those error calls are three frames above any tmpfile and the grep can never match -- the suite failed 8/9 against correct code. Assert on the failure branch of _docker_install_from_script() itself, where the cleanup actually lives. Verified: suite goes 8 passed/1 failed -> 9/9, and deleting the real 'rm -f "$tmpfile"' from the helper's error branch puts it back to 8/1, so the assertion still catches the regression it was written for.
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.
Problem: Test 8 grepped 2 lines above error "Docker installation failed. Cleanup had since moved into _docker_install_from_script() (05-docker.sh:49-57), three levels below those call sites — which hold no tmpfile at all. The test failed against correct code.
Fix: awk-extract the helper body and assert on its failure branch.