From 4cfaabdda0c24da1d6c7545be8c1ebfcd57e6ccd Mon Sep 17 00:00:00 2001 From: Sasha Melentyev Date: Mon, 25 Jul 2022 18:13:47 +0300 Subject: [PATCH] chore(ztest/timeout): capture original scale after err handling (#1138) --- internal/ztest/timeout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ztest/timeout.go b/internal/ztest/timeout.go index f7d58f316..e4222f947 100644 --- a/internal/ztest/timeout.go +++ b/internal/ztest/timeout.go @@ -42,11 +42,11 @@ func Sleep(base time.Duration) { // Initialize checks the environment and alters the timeout scale accordingly. // It returns a function to undo the scaling. func Initialize(factor string) func() { - original := _timeoutScale fv, err := strconv.ParseFloat(factor, 64) if err != nil { panic(err) } + original := _timeoutScale _timeoutScale = fv return func() { _timeoutScale = original } }