From cdb767f6631f573184725ccf386aa5e6c668c7f3 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Thu, 20 Jun 2024 11:45:49 +0400 Subject: [PATCH] fix: fix flake in TestAppHealth_Healthy --- agent/apphealth_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agent/apphealth_test.go b/agent/apphealth_test.go index dbcb40b7e69e9..ff411433e3821 100644 --- a/agent/apphealth_test.go +++ b/agent/apphealth_test.go @@ -56,15 +56,16 @@ func TestAppHealth_Healthy(t *testing.T) { Health: codersdk.WorkspaceAppHealthInitializing, }, } - checks := make(map[string]int) + checks2 := 0 + checks3 := 0 handlers := []http.Handler{ nil, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - checks["app2"]++ + checks2++ httpapi.Write(r.Context(), w, http.StatusOK, nil) }), http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - checks["app3"]++ + checks3++ httpapi.Write(r.Context(), w, http.StatusOK, nil) }), } @@ -109,8 +110,8 @@ func TestAppHealth_Healthy(t *testing.T) { require.Equal(t, codersdk.WorkspaceAppHealthHealthy, apps[2].Health) // ensure we aren't spamming - require.Equal(t, 2, checks["app2"]) - require.Equal(t, 1, checks["app3"]) + require.Equal(t, 2, checks2) + require.Equal(t, 1, checks3) } func TestAppHealth_500(t *testing.T) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy