From 9f7eac80ce3477b9f57b0a3ec55572c973098734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Va=C5=A1ek?= Date: Wed, 12 Jun 2024 18:01:03 +0200 Subject: [PATCH] test: better res cleanup (#2349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matej VaĊĦek --- pkg/functions/client_int_test.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/functions/client_int_test.go b/pkg/functions/client_int_test.go index 6c789c7f09..e335d617d0 100644 --- a/pkg/functions/client_int_test.go +++ b/pkg/functions/client_int_test.go @@ -303,11 +303,8 @@ func TestRemove(t *testing.T) { if _, f, err = client.New(context.Background(), f); err != nil { t.Fatal(err) } - waitFor(t, client, "remove", DefaultNamespace) - if err = client.Remove(context.Background(), "", "", f, false); err != nil { - t.Fatal(err) - } + del(t, client, "remove", DefaultNamespace) names, err := client.List(context.Background(), DefaultNamespace) if err != nil { @@ -408,7 +405,7 @@ func Handle(ctx context.Context, res http.ResponseWriter, req *http.Request) { if err := f.Write(); err != nil { t.Fatal(err) } - defer client.Remove(ctx, "", "", f, true) + defer del(t, client, "f", DefaultNamespace) // Invoke via the route resp, err := http.Get(route) @@ -473,7 +470,7 @@ func Handle(ctx context.Context, res http.ResponseWriter, req *http.Request) { if _, f, err = client.Apply(ctx, f); err != nil { t.Fatal(err) } - defer client.Remove(ctx, "", "", f, true) + defer del(t, client, "a", DefaultNamespace) // Create Function B // which responds with the response from an invocation of 'a' via the @@ -529,7 +526,7 @@ func Handle(ctx context.Context, w http.ResponseWriter, req *http.Request) { if route, f, err = client.Apply(ctx, f); err != nil { t.Fatal(err) } - defer client.Remove(ctx, "", "", f, true) + defer del(t, client, "b", DefaultNamespace) resp, err := http.Get(route) if err != nil {