[gdb/testsuite] Give up after consecutive timeouts in completion-support.exp
authorTom de Vries <tdevries@suse.de>
Tue, 17 Mar 2020 07:56:35 +0000 (08:56 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 17 Mar 2020 07:56:35 +0000 (08:56 +0100)
commit7325b16ba4dc33a54356fd2b8fde79311c51b121
treecd4fdd7a90ca30de1b97dfd30cb6eebf6a671227
parent771dd3a88b1f0e03a110fc4f2207913df45f8b4b
[gdb/testsuite] Give up after consecutive timeouts in completion-support.exp

When running test-case gdb.linespec/cpcompletion.exp with target board
unix/-flto/-O0/-flto-partition=none/-ffat-lto-objects, we run into lots of
timeouts, in particular with this pattern:
...
FAIL: gdb.linespec/cpcompletion.exp: template-ret-type: \
  cmd complete "b template2_"
FAIL: gdb.linespec/cpcompletion.exp: template-ret-type: \
  tab complete "b template2_st" (timeout)
FAIL: gdb.linespec/cpcompletion.exp: template-ret-type: \
  cmd complete "b template2_st"
FAIL: gdb.linespec/cpcompletion.exp: template-ret-type: \
  tab complete "b template2_str" (timeout)
FAIL: gdb.linespec/cpcompletion.exp: template-ret-type: \
  cmd complete "b template2_str"
FAIL: gdb.linespec/cpcompletion.exp: template-ret-type: \
  tab complete "b template2_stru" (timeout)
...

Fix this by detecting timeouts in test_complete_prefix_range_re and giving up
after 3 consecutive timeouts.

This reduces testing time from ~39m to ~9m.

Tested on x86_64-linux.
gdb/testsuite/lib/completion-support.exp