mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 16:33:11 -06:00
common/test/client: Handle timed out requests for tests that passed
This commit is contained in:
parent
f48c293cb0
commit
e3b18f9138
|
|
@ -129,8 +129,12 @@ func (r *Request) Run(label string, timeout time.Duration, serverCmdChan chan er
|
||||||
// - the server to exit with an error (error sent on serverCmdChan)
|
// - the server to exit with an error (error sent on serverCmdChan)
|
||||||
// - our test timeout to expire
|
// - our test timeout to expire
|
||||||
// We don't need to clean up since the main() function handles that in the event we panic
|
// We don't need to clean up since the main() function handles that in the event we panic
|
||||||
|
var testPassed bool
|
||||||
select {
|
select {
|
||||||
case <-time.After(timeout):
|
case <-time.After(timeout):
|
||||||
|
if testPassed {
|
||||||
|
break
|
||||||
|
}
|
||||||
fmt.Printf("==TESTING== %v TIMEOUT\n", label)
|
fmt.Printf("==TESTING== %v TIMEOUT\n", label)
|
||||||
if reqErr := r.LastErr.Get(); reqErr != nil {
|
if reqErr := r.LastErr.Get(); reqErr != nil {
|
||||||
fmt.Println("Last /sync request error:")
|
fmt.Println("Last /sync request error:")
|
||||||
|
|
@ -146,6 +150,7 @@ func (r *Request) Run(label string, timeout time.Duration, serverCmdChan chan er
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
case <-done:
|
case <-done:
|
||||||
|
testPassed = true
|
||||||
fmt.Printf("==TESTING== %v PASSED\n", label)
|
fmt.Printf("==TESTING== %v PASSED\n", label)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue