From aec3adfa6d8a06269e968c3916fa0f42a4f6a0ca Mon Sep 17 00:00:00 2001 From: Yehoyada Date: Thu, 17 Oct 2024 23:04:06 +0300 Subject: [PATCH] Parallel tests and remove debug print --- middlewares/cache.go | 2 -- middlewares/cache_test.go | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/middlewares/cache.go b/middlewares/cache.go index 27642fc..fc58be5 100644 --- a/middlewares/cache.go +++ b/middlewares/cache.go @@ -1,7 +1,6 @@ package middlewares import ( - "fmt" "net/http" "strconv" "strings" @@ -33,7 +32,6 @@ func NewCacheMiddleware() Middleware { } w.WriteHeader(response.statusCode) w.Write(response.body) - fmt.Println("Returning cached") return } diff --git a/middlewares/cache_test.go b/middlewares/cache_test.go index 08fb10e..eac245d 100644 --- a/middlewares/cache_test.go +++ b/middlewares/cache_test.go @@ -8,6 +8,7 @@ import ( ) func TestCacheMiddleware(t *testing.T) { + t.Parallel() // Reset cache before each test responseCache.Flush() @@ -166,6 +167,7 @@ func TestCacheMiddleware(t *testing.T) { } func TestGetCacheMaxAge(t *testing.T) { + t.Parallel() tests := []struct { name string cacheControl string @@ -189,6 +191,8 @@ func TestGetCacheMaxAge(t *testing.T) { } func TestGetCacheExpires(t *testing.T) { + t.Parallel() + now := time.Now() tests := []struct { name string