chore: enable usetesting linter (#21935)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-02-21 19:50:55 +01:00
committed by GitHub
parent 7870200461
commit 37aaeb3dd9
10 changed files with 14 additions and 13 deletions

View File

@@ -3,7 +3,6 @@ package common
import (
"context"
"fmt"
"os"
"strconv"
"testing"
"time"
@@ -29,7 +28,7 @@ func Test_GRPCKeepAliveMinNotSet(t *testing.T) {
// Test valid env var set for EnvGRPCKeepAliveMin
func Test_GRPCKeepAliveMinIsSet(t *testing.T) {
numSeconds := 15
os.Setenv(EnvGRPCKeepAliveMin, fmt.Sprintf("%ds", numSeconds))
t.Setenv(EnvGRPCKeepAliveMin, fmt.Sprintf("%ds", numSeconds))
grpcKeepAliveMin := GetGRPCKeepAliveEnforcementMinimum()
grpcKeepAliveExpectedMin := time.Duration(numSeconds) * time.Second
@@ -42,7 +41,7 @@ func Test_GRPCKeepAliveMinIsSet(t *testing.T) {
// Test invalid env var set for EnvGRPCKeepAliveMin
func Test_GRPCKeepAliveMinIncorrectlySet(t *testing.T) {
numSeconds := 15
os.Setenv(EnvGRPCKeepAliveMin, strconv.Itoa(numSeconds))
t.Setenv(EnvGRPCKeepAliveMin, strconv.Itoa(numSeconds))
grpcKeepAliveMin := GetGRPCKeepAliveEnforcementMinimum()
grpcKeepAliveExpectedMin := defaultGRPCKeepAliveEnforcementMinimum