From fe103371e1a6998fe638ef7e3ebb70d477a7b331 Mon Sep 17 00:00:00 2001 From: Softonik Date: Fri, 27 Jun 2025 01:32:08 +0300 Subject: [PATCH] +SetTestDeadlockProtection --- godog_and_gomega_helpers.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/godog_and_gomega_helpers.go b/godog_and_gomega_helpers.go index 98cf166..ae90ef9 100644 --- a/godog_and_gomega_helpers.go +++ b/godog_and_gomega_helpers.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "strconv" + "time" . "github.com/onsi/gomega" ) @@ -43,3 +44,11 @@ func Atof(in string) float64 { Ok(err) return res } + +func SetTestDeadlockProtection() { + go checkTestTimeout(1 * time.Second) +} +func checkTestTimeout(t time.Duration) { + <-time.After(t) + panic("Test Suite Timeout") +}