Skip to content

Commit

Permalink
test: better res cleanup (#2349)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Vašek <[email protected]>
  • Loading branch information
matejvasek authored Jun 12, 2024
1 parent ac63d52 commit 9f7eac8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/functions/client_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9f7eac8

Please sign in to comment.