Update Go version to 1.24 (#3167)
* Update Go version to 1.24 * Update golangci-lint version * Add envtest to tool * Add dashboard linter as a tool * Uset t.Cleanup --------- Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -37,7 +37,7 @@ const (
|
||||
func TestRefreshFuncPods(t *testing.T) {
|
||||
os.Setenv("DEBUG_ENV", "true")
|
||||
mgr := manager.New()
|
||||
defer mgr.Wait()
|
||||
t.Cleanup(mgr.Wait)
|
||||
logger := loggerfactory.GetLogger()
|
||||
kubernetesClient := fake.NewSimpleClientset()
|
||||
fissionClient := fClient.NewSimpleClientset()
|
||||
@@ -50,8 +50,7 @@ func TestRefreshFuncPods(t *testing.T) {
|
||||
}
|
||||
ndmInformerFactory := utils.GetInformerFactoryByExecutor(kubernetesClient, executorLabel, time.Minute*30)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
fetcherConfig, err := fetcherConfig.MakeFetcherConfig("/userfunc")
|
||||
if err != nil {
|
||||
|
||||
@@ -16,7 +16,6 @@ limitations under the License.
|
||||
package poolmgr
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -39,9 +38,8 @@ import (
|
||||
|
||||
func TestPoolPodControllerPodCleanup(t *testing.T) {
|
||||
mgr := manager.New()
|
||||
defer mgr.Wait()
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
t.Cleanup(mgr.Wait)
|
||||
ctx := t.Context()
|
||||
logger := loggerfactory.GetLogger()
|
||||
kubernetesClient := fake.NewSimpleClientset()
|
||||
fissionClient := fClient.NewSimpleClientset()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package fscache
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -157,8 +156,7 @@ func TestFunctionServiceNewCache(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
fsc.AddFunc(ctx, *fsvc, 10, fn.GetRetainPods())
|
||||
concurrency := 10
|
||||
|
||||
@@ -24,8 +24,7 @@ func checkErr(err error) {
|
||||
}
|
||||
|
||||
func TestPoolCache(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
logger := loggerfactory.GetLogger()
|
||||
concurrency := 5
|
||||
requestsPerPod := 2
|
||||
|
||||
@@ -16,7 +16,6 @@ limitations under the License.
|
||||
package hpa
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -58,8 +57,7 @@ func TestHpaOps(t *testing.T) {
|
||||
t.Errorf("Expected instanceID to be %v, got %v", instanceID, hpaops.instanceID)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
deployLabels := map[string]string{
|
||||
"test-label": "test-label-value",
|
||||
|
||||
Reference in New Issue
Block a user