mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-11-04 00:11:04 +00:00 
			
		
		
		
	Merge pull request 'test: remove performance sensitive test' (#4315) from earl-warren/forgejo:wip-redis-test into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4315 Reviewed-by: twenty-panda <twenty-panda@noreply.codeberg.org>
This commit is contained in:
		
				commit
				
					
						938e6c0fd7
					
				
			
		
					 1 changed files with 0 additions and 13 deletions
				
			
		
							
								
								
									
										13
									
								
								modules/cache/cache_test.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								modules/cache/cache_test.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -9,7 +9,6 @@ import (
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/modules/setting"
 | 
						"code.gitea.io/gitea/modules/setting"
 | 
				
			||||||
	"code.gitea.io/gitea/modules/test"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					@ -35,18 +34,6 @@ func TestNewContext(t *testing.T) {
 | 
				
			||||||
	assert.Nil(t, con)
 | 
						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) {
 | 
					func TestGetCache(t *testing.T) {
 | 
				
			||||||
	createTestCache()
 | 
						createTestCache()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue