-
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
Bazel run for a test target under GDB exits immediately #6145
Comments
This is because the test is actually run as a background process for various interesting reasons (/cc @ola-rozenfeld): https://github.com/bazelbuild/bazel/blob/master/tools/test/test-setup.sh#L264 Given that you have workaround, I'd not spend too much time fixing this -- it's conceivable that we could do some shell magic to do so, but we do enough shell magic there already so I'm reluctant to add more. |
Is there no way to differentiate when the test target is executed with Maybe it would be acceptable to just mimic the normal |
Jain, as they say in German... sure, it's possible, but some people expect tests being run as a test under |
@lberki which is the subteam that should own this? |
Put this down as "local exec" for... well, lack of a better one. |
I gave this a try and noticed that this has become "worse" now, as the test execution will now stall under gdb and not accept any input. Ctrl+Z causes the test to be killed though. |
I just ran into this myself (not using The command line option approach, mentioned above, seems wrong to my mind as it makes the person executing the bazel command be in charge of understanding the difference. I'd much rather have the intent encoded in the build files. Not to mention your aversion (totally understandable) to adding to the ever increasing list. I have two potential suggestions:
I think both would be a lot cleaner and a better model. Any comments? |
Re-encountered this here: But yeah, just running test binary via \cc @jwnimmer-tri - prolly something you already knew about |
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 1+ 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:
When executing
bazel run --run_under=gdb
with the newdirect_run
feature seems to work as expected for*_binary
targets. However if you try tobazel run ...
a*_test
target it doesn't appear to be redirecting stdin as expected.Note: This wrapper script is a work around
gdb_tty.sh
and then use
bazel run --run_under=gdb_tty.sh ...
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
So for instance
Works great. In contrast, when trying to run a test target:
And ends immediately.
What operating system are you running Bazel on?
Ubuntu 16.04
What's the output of
bazel info release
?release 0.16.1
Have you found anything relevant by searching the web?
#2815
https://groups.google.com/forum/#!topic/bazel-discuss/Mu95dnuA2MQ
The text was updated successfully, but these errors were encountered: