-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Tests run without (network) sandboxing when --java_debug is set #6379
Comments
cc @ittaiz |
What kind of test are we talking about here? Java tests? For these, this is working as intended - because "debugging a test" involves starting it with the options to listen on a remote debugging port and you can only connect to that port when the network sandbox is disabled. |
Java tests, that interact with the outside world, to be precise. It isn't a critical issue, but it comes to be a nuisance when investigating the test failures The most basic idea that comes mind - is it possible to block network for all, but debugger traffic? |
just for completeness sake, tagging this as relevant to #2765 , as this can add to confusion when triaging tests in sandboxed/non-sandboxed mode. |
While i do agree that it will help with not caching false positive test result, the issue lies in the fact, that running test in debug succeeds, while a normal run fails. And that, in turn, is caused by silently disabling the network blocking. |
I think this happens because of: whereby As far as I can tell, the sandbox allows local network connectivity but not external network connectivity. (Though what "local" means currently depends on the platform, with Linux not allowing connectivity outside of the process' namespace, and macOS not allowing connectivity outside of the machine.) It seems like we could enable sandboxing for tests though and assume that the debugger has to run on the same machine? Or we could maybe find a way to tunnel the connection out of the sandbox into the host, so that we could block everything except that... |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2.5 years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
Description of the problem / feature request:
Running test in debug mode reverts network blocking, causing tests, that fail during run, pass on a debug
Feature requests: what underlying problem are you trying to solve with this feature?
Having network enabled on a debug mode causes tests, that try to access network & fail on normal run, to pass.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Have a test calling external service. Normal run would fail, while debug - pass
What operating system are you running Bazel on?
MacOs
What's the output of
bazel info release
?release 0.17.2
The text was updated successfully, but these errors were encountered: