Fix 'gdb.base/quit.exp hangs forever' if the test fails
authorPedro Alves <palves@redhat.com>
Fri, 20 Oct 2017 14:33:57 +0000 (15:33 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 20 Oct 2017 14:33:57 +0000 (15:33 +0100)
commit15763a09d4aea85fc3153d6746c040dd48565637
tree25800953f2df375de0b87045f0d75b7840de978a
parentfcc8fb2f3de370f2def30bb18c98243ed4f3fb8c
Fix 'gdb.base/quit.exp hangs forever' if the test fails

The [wait -i $gdb_spawn_id] in the test is dangerous in the sense that
it won't be subject to timeout logic.  So if GDB fails quiting, this
testcase hangs forever, hanging the test run with it.  See:
  https://sourceware.org/ml/gdb-patches/2016-10/msg00728.html

Instead of 'wait'ing directly, use gdb_test_multiple and expect 'eof'.

Tested that the testcase no longer hangs by hacking the test to send
"info threads" instead of "quit".

Tested with
  --target_board={unix, native-gdbserver,native-extended-gdbserver}
and tested with
  --host_board=local-remote-host
as well.

gdb/testsuite/ChangeLog:
2017-10-20  Pedro Alves  <palves@redhat.com>

* gdb.base/quit.exp: Use gdb_test_multiple and expect 'eof' before
'wait -i'.  Use gdb_assert and remote_close.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/quit.exp
This page took 0.032764 seconds and 4 git commands to generate.