[PATCH v5 02/13] CI: Reduce timeout on test failure

Marek Marczykowski-Górecki <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <a61efbd50844b2c3084182faa73d629d45250575.1785941707.git-series.marmarek@invisiblethingslab.com>
Tests can specify two expressions to look for:
- PASSED variable: what to look for in a successful test
- LOG_MSG variable: what marks end of test execution (regardless of the
  result)

If the latter is found, do not wait full timeout for the former one
(which will never be found in a failed test), but check for it with a
short timeout instead. In a successful test it's supposed to be in the
expect's buffer already, and in a failed test it will never arrive.

This should reduce waiting time in case of a failed test.

Note the other case (when PASSED is found first), the timeout should not
be reduced, as test may execute some more after determining the result
(for example it may collect logs for uploading).

Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
New in v5
---
 automation/scripts/console.exp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/automation/scripts/console.exp b/automation/scripts/console.exp
index e27886bbef23..d65f840a315e 100755
--- a/automation/scripts/console.exp
+++ b/automation/scripts/console.exp
@@ -65,6 +65,7 @@ if {[info exists env(LOG_MSG)]} {
             exit 0
         }
         -notransfer -re "$env(LOG_MSG)" {
+            set timeout 10
             expect -re "$env(PASSED)"
             exit 0
         }
-- 
git-series 0.9.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.