Explorar el Código

Merge pull request #4206 from xiang90/fix_test

storage: extend timeout for slow CI
Xiang Li hace 10 años
padre
commit
a8a786598d
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      storage/kvstore_test.go

+ 6 - 1
storage/kvstore_test.go

@@ -20,6 +20,7 @@ import (
 	"math"
 	"math"
 	"os"
 	"os"
 	"reflect"
 	"reflect"
+	"runtime"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
@@ -455,7 +456,11 @@ func TestTxnBlockBackendForceCommit(t *testing.T) {
 	s.TxnEnd(id)
 	s.TxnEnd(id)
 	select {
 	select {
 	case <-done:
 	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")
 		t.Fatalf("failed to execute ForceCommit")
 	}
 	}
 }
 }