From 11596374ba1fb302a94022adf83efa693c59125b Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 4 Jul 2024 06:57:26 +0200 Subject: [PATCH] test: remove performance sensitive test A test must not fail depending on the performance of the machine it runs on. It creates false negative and serves no purpose. These are not benchmark tests for the hardware running them. --- modules/cache/cache_test.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/modules/cache/cache_test.go b/modules/cache/cache_test.go index 0e7e7a647c..3f65040924 100644 --- a/modules/cache/cache_test.go +++ b/modules/cache/cache_test.go @@ -9,7 +9,6 @@ import ( "time" "code.gitea.io/gitea/modules/setting" - "code.gitea.io/gitea/modules/test" "github.com/stretchr/testify/assert" ) @@ -35,18 +34,6 @@ func TestNewContext(t *testing.T) { assert.Nil(t, con) } -func TestTest(t *testing.T) { - defer test.MockVariableValue(&conn, nil)() - _, err := Test() - assert.Error(t, err) - - createTestCache() - elapsed, err := Test() - assert.NoError(t, err) - // mem cache should take from 300ns up to 1ms on modern hardware ... - assert.Less(t, elapsed, SlowCacheThreshold) -} - func TestGetCache(t *testing.T) { createTestCache()