]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: Fix flakiness in gdb.base/default.exp
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Thu, 3 Apr 2025 05:00:25 +0000 (02:00 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Tue, 27 May 2025 01:41:37 +0000 (22:41 -0300)
commitc833b2b5e8be66e8fc1276a33391eef08c9ff605
tree5d71e54d5343fefaa01085f074c5e9a8f1e53323
parentd13aaae402ff9cce91f53fe272f59f358c59ece2
gdb/testsuite: Fix flakiness in gdb.base/default.exp

The Linaro CI runs the GDB testsuite using the read1 tool, which
significantly increases the time it takes DejaGNU to read inferior output.
On top of that sometimes the test machine has higher than normal load,
which causes tests to run even slower.

Because gdb.base/default.exp tests some verbose commands such as "info
set", it sometimes times out while waiting for the complete command
output when running in the Linaro CI environment.

Fix this problem by consuming each line of output from the most verbose
commands with gdb_test_multiple's -lbl (line-by-line) option — which
causes DejaGNU to reset the timeout after each match — and also by
breaking up regular expressions that try to match more than 2000
characters (the default Expect buffer size) in one go into multiple
matches.

Some tests use the same regular expression, so I created a procedure for
them.  This is the case for "i" / "info", "info set" / "show", and "set
print" tests.

The tests for "show print" don't actually test their output, so this
patch improves them by checking some lines of the output.

Reviewed-By: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/testsuite/gdb.base/default.exp