Set timeout for gdb.reverse/*.exp test cases

Message ID 1399646397-32587-1-git-send-email-yao@codesourcery.com
State Committed
Headers

Commit Message

Yao Qi May 9, 2014, 2:39 p.m. UTC
  Hi,
This patch is to add a new board setting gdb_reverse_timeout, which is
used to set timeout for all gdb.reverse test cases, which are usually
very slow and cause some TIMEOUT failures, for example, on some arm
boards.  We have some alternatives to this approach, but I am not
satisfied with them:

 - Increase the timeout value.  This is the global change, and it may
   cause some delay where actual failures happen.
 - Set timeout by gdb_reverse_timeout in every gdb.reverse/*.exp.
   Then, we have to touch every file under gdb.reverse.

In this patch, we choose a central place to set timeout for all tests
in gdb.reverse, which is convenient.

gdb/testsuite:

2014-05-09  Yao Qi  <yao@codesourcery.com>

	* lib/gdb.exp (gdb_init): Set timeout if test file is under
	gdb.reverse directory and gdb_reverse_timeout exists in board
	setting.
	* README: Document gdb_reverse_timeout.
---
 gdb/testsuite/README      | 9 +++++++++
 gdb/testsuite/lib/gdb.exp | 5 +++++
 2 files changed, 14 insertions(+)
  

Comments

Eli Zaretskii May 9, 2014, 3:02 p.m. UTC | #1
> From: Yao Qi <yao@codesourcery.com>
> Date: Fri, 9 May 2014 22:39:57 +0800
> 
> +failures.  This global variable is useful to bump up the value of
> +`timeout' for gdb.reverse tests and doesn't cause any delay where
> +actual failure happen in the rest of the testsuite.
          ^^^^^^^^^^^^^^
Either "failures" or "happens".

Thanks.
  
Yao Qi May 16, 2014, 12:39 p.m. UTC | #2
On 05/09/2014 10:39 PM, Yao Qi wrote:
> This patch is to add a new board setting gdb_reverse_timeout, which is
> used to set timeout for all gdb.reverse test cases, which are usually
> very slow and cause some TIMEOUT failures, for example, on some arm
> boards.  We have some alternatives to this approach, but I am not
> satisfied with them:
> 
>  - Increase the timeout value.  This is the global change, and it may
>    cause some delay where actual failures happen.
>  - Set timeout by gdb_reverse_timeout in every gdb.reverse/*.exp.
>    Then, we have to touch every file under gdb.reverse.
> 
> In this patch, we choose a central place to set timeout for all tests
> in gdb.reverse, which is convenient.
> 
> gdb/testsuite:
> 
> 2014-05-09  Yao Qi  <yao@codesourcery.com>
> 
> 	* lib/gdb.exp (gdb_init): Set timeout if test file is under
> 	gdb.reverse directory and gdb_reverse_timeout exists in board
> 	setting.
> 	* README: Document gdb_reverse_timeout.

Anyone review the non-doc bits of this patch?
https://sourceware.org/ml/gdb-patches/2014-05/msg00113.html
  
Tom Tromey May 16, 2014, 6:39 p.m. UTC | #3
>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

>> 2014-05-09  Yao Qi  <yao@codesourcery.com>
>> * lib/gdb.exp (gdb_init): Set timeout if test file is under
>> gdb.reverse directory and gdb_reverse_timeout exists in board
>> setting.
>> * README: Document gdb_reverse_timeout.

Ok.

Tom
  
Yao Qi May 20, 2014, 6:07 a.m. UTC | #4
On 05/17/2014 02:39 AM, Tom Tromey wrote:
>>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
> 
>>> 2014-05-09  Yao Qi  <yao@codesourcery.com>
>>> * lib/gdb.exp (gdb_init): Set timeout if test file is under
>>> gdb.reverse directory and gdb_reverse_timeout exists in board
>>> setting.
>>> * README: Document gdb_reverse_timeout.
> 
> Ok.
> 

Patch is pushed in.
  

Patch

diff --git a/gdb/testsuite/README b/gdb/testsuite/README
index e6d5318..cbc4e20 100644
--- a/gdb/testsuite/README
+++ b/gdb/testsuite/README
@@ -203,6 +203,15 @@  The default value of the timeout is defined in the file
 `testsuite/config/unix.exp' (at least for Unix hosts; board files may
 have their own values).
 
+gdb_reverse_timeout
+
+Defining this variable changes the default timeout duration when tests
+under gdb.reverse directory are running.  Process record and reverse
+debugging is so slow that its tests have unexpected `TIMEOUT' test
+failures.  This global variable is useful to bump up the value of
+`timeout' for gdb.reverse tests and doesn't cause any delay where
+actual failure happen in the rest of the testsuite.
+
 
 Board Settings
 **************
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index aec86cd..24e2f23 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3691,6 +3691,11 @@  proc gdb_init { test_file_name } {
     global timeout
     set timeout $gdb_test_timeout
 
+    if { [regexp ".*gdb\.reverse\/.*" $test_file_name]
+	 && [target_info exists gdb_reverse_timeout] } {
+	set timeout [target_info gdb_reverse_timeout]
+    }
+
     # If GDB_INOTIFY is given, check for writes to '.'.  This is a
     # debugging tool to help confirm that the test suite is
     # parallel-safe.  You need "inotifywait" from the