From 0cba12d991202ffc7e6d8e9c0c58b65f1ff0503b Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 13 Jan 2016 15:37:45 -0800 Subject: [PATCH] storage: extend timeout for slow CI 1. extend timeout 2. print out stacktrace. When it fails again, we can get more confidence that the failure is caused by slow IO. --- storage/kvstore_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/storage/kvstore_test.go b/storage/kvstore_test.go index 10c4b9a10..c5fdae0e5 100644 --- a/storage/kvstore_test.go +++ b/storage/kvstore_test.go @@ -20,6 +20,7 @@ import ( "math" "os" "reflect" + "runtime" "testing" "time" @@ -455,7 +456,11 @@ func TestTxnBlockBackendForceCommit(t *testing.T) { s.TxnEnd(id) select { case <-done: - case <-time.After(time.Second): + case <-time.After(5 * time.Second): // wait 5 seconds for CI with slow IO + // print out stack traces of all routines if there is a failure + stackTrace := make([]byte, 8*1024) + n := runtime.Stack(stackTrace, true) + t.Error(string(stackTrace[:n])) t.Fatalf("failed to execute ForceCommit") } }