+SetTestDeadlockProtection
Этот коммит содержится в:
родитель
61d22264e4
коммит
fe103371e1
1 изменённых файлов: 9 добавлений и 0 удалений
|
@ -4,6 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
@ -43,3 +44,11 @@ func Atof(in string) float64 {
|
||||||
Ok(err)
|
Ok(err)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SetTestDeadlockProtection() {
|
||||||
|
go checkTestTimeout(1 * time.Second)
|
||||||
|
}
|
||||||
|
func checkTestTimeout(t time.Duration) {
|
||||||
|
<-time.After(t)
|
||||||
|
panic("Test Suite Timeout")
|
||||||
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче