-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base.runtests
: add environment variables for overriding the automatic networking detection
#43217
Conversation
…ic networking detection
Can you add this to the help message from runtests? |
Thanks for that, it is a neat workaround to the underlying problem (why should getipaddr fail when there's a loopback interface and a valid IP address set (127.0.0.1) ?). The same comment I made here: #43211 (comment). If getipaddr could be made to work normally in the container we wouldn't need JULIA_TEST_USE_MULTIPLE_WORKERS. |
I could, but that would mean making these environment variables part of the public API. I was thinking that because the use case here is very narrow, we could just keep it non-public API for now, which gives us the freedom to make breaking changes in the future. |
I should have been more precise, I meant the help printed on line 84, which is not a stable API promise, but is the documentation of the current API: If you want, you can also mention there that this is not suitable for use in scripts (it is "porcelain") |
What happens if The automatic network detection should be not bypassed. The only issue is being able to set The correct fix is to fix This patch #43217 adds complexity and corner-cases without solving the real issue of BTW, I do not understand why PR #43211 is closed without providing an explanation and why #43217 would be better (when it does not appear to be). Especially when explanations #43211 (comment) or #43211 (comment) discuss why #43217 does not look better than the trivial #43211. |
If networking is truly not available, the user should not set |
I don't completely follow your comments. If I understand correctly, for your specific use case, Is that a correct description of your specific use case? If so, just follow the instructions below.
|
#43211 was closed because it does not make sense to add logic for these very specific edge cases (e.g. Nix or GNU Guix) based on the presence or absence of the commonly-used If we want to add logic for a rare edge case, we should add a dedicated environment variable for that edge case. That's exactly what this PR did. |
Yes.
I understand how to use the merged proposal. :-) My point is: it is incorrect to bypass the network check. Because it is against the principle of least astonishment (POLA) for user interface. Concretely, from my point of view, this test if !JULIA_TEST_NETWORKING_AVAILABLE
try
ipa = getipaddr() is incorrect because POLA, whereas this test if net_on || JULIA_TEST_USE_MULTIPLE_WORKERS
n = min(Sys.CPU_THREADS, length(tests)) is correct because it fixes buggy Anyway, talk does not cook the rice. ;-) Thanks for the quick fix. Cheers! |
…ic networking detection (JuliaLang#43217)
…ic networking detection (JuliaLang#43217)
Closes #43211
Description
This pull request adds two environment variables for overriding the automatic networking detection that we perform before we run the test suite.
To force Julia to use multiple worker processes, even if
Sockets.getipaddr()
throws an exception, set theJULIA_TEST_USE_MULTIPLE_WORKERS
environment variable totrue
.To force Julia to use multiple worker processes AND to force Julia to run the tests that require network connectivity, even if
Sockets.getipaddr()
throws an exception, set theJULIA_TEST_NETWORKING_AVAILABLE
environment variable totrue
.Examples
Example 1
Suppose that:
Sockets.getipaddr()
throws an exception when run in your build environment.Artifacts
,Downloads
, etc.).To accomplish this, you would run the following commands:
Example 2
Suppose that:
Sockets.getipaddr()
throws an exception when run in your build environment.Artifacts
,Downloads
, etc.).To accomplish this, you would run the following commands: