Skip to content

fix(tests): tmpfile-cleanup assertion matched a call site that no lon… - #5000

Open
AniketBajaj2024 wants to merge 1 commit into
Osmantic:mainfrom
AniketBajaj2024:fix/tmpfile-cleanup-test-stale-error-path-assert
Open

fix(tests): tmpfile-cleanup assertion matched a call site that no lon…#5000
AniketBajaj2024 wants to merge 1 commit into
Osmantic:mainfrom
AniketBajaj2024:fix/tmpfile-cleanup-test-stale-error-path-assert

Conversation

@AniketBajaj2024

Copy link
Copy Markdown
Contributor

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.

…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.
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