test-arg-parser: skip download tests when network is unreachable (fix flaky CI) - #65
Merged
Merged
Conversation
The download tests make live HTTP requests to http://ggml.ai/ and assert on the response. Network-restricted CI runners (self-hosted, windows-vulkan) can't reach it, so the good-URL GET fails and takes the whole arg-parser suite down on an unrelated connectivity issue. Probe the endpoint once and assert the download semantics only when it is actually reachable; otherwise print a notice and skip. No behavior change when network is present.
| assert(str.find("llama.cpp") != std::string::npos); | ||
| network_ok = true; | ||
| } else { | ||
| printf(" good URL returned %d, no usable network -- skipping download tests\n\n", res.first); |
There was a problem hiding this comment.
Pull request overview
Makes download-related argument parser tests skip when the remote endpoint is unreachable.
Changes:
- Probes the good URL with exception handling.
- Gates remaining download tests on probe success.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+194
to
+200
| if (res.first == 200 && res.second.size() > 0) { | ||
| std::string str(res.second.data(), res.second.size()); | ||
| assert(str.find("llama.cpp") != std::string::npos); | ||
| network_ok = true; | ||
| } else { | ||
| printf(" good URL returned %d, no usable network -- skipping download tests\n\n", res.first); | ||
| } |
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.
What
test-arg-parsermakes live HTTP requests tohttp://ggml.ai/and asserts on the response (200 + body, 404, max-size error). On network-restricted CI runners (self-hosted, and thewindows (x64-vulkan)job) the endpoint is unreachable, so the good-URL GET fails and the assert takes down the whole arg-parser suite on an unrelated connectivity issue.This probes the endpoint once and asserts the download semantics only when it is actually reachable; otherwise it prints a notice and skips those sub-tests. No behavior change when the network is present (all download tests still run and assert).
Why
Seen failing on
windows (x64-vulkan)(error: cannot make GET request) while the build itself succeeded — a flaky, environment-dependent failure unrelated to the code under test.Test
Builds + runs locally with network present: all download tests execute and pass (
test-arg-parser: all tests OK). With no network, they skip cleanly.