diff --git a/gdb/testsuite/gdb.threads/non-stop-fair-events.exp b/gdb/testsuite/gdb.threads/non-stop-fair-events.exp index e2d3f7d..1570d3f 100644 --- a/gdb/testsuite/gdb.threads/non-stop-fair-events.exp +++ b/gdb/testsuite/gdb.threads/non-stop-fair-events.exp @@ -135,16 +135,22 @@ proc test {signal_thread} { # Wait for all threads to finish their steps, and for the main # thread to hit the breakpoint. + # Running this many threads may be quite slow on remote targets, + # so factor the timeout according to how many threads are running. + set max_timeout $NUM_THREADS for {set i 1} { $i <= $NUM_THREADS } { incr i } { set test "thread $i broke out of loop" - gdb_test_multiple "" $test { - -re "loop_broke" { - # The prompt was already matched in the "continue - # &" test above. We're now consuming asynchronous - # output that comes after the prompt. - pass $test + with_timeout_factor $max_timeout { + gdb_test_multiple "" $test { + -re "loop_broke" { + # The prompt was already matched in the "continue + # &" test above. We're now consuming asynchronous + # output that comes after the prompt. + pass $test + } } } + set max_timeout [expr $max_timeout - 1] } # It's helpful to have this in the log if the test ever