summaryrefslogtreecommitdiffstats
path: root/tests/integration/integration_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-22 21:09:35 +0800
committerGitHub <noreply@github.com>2022-12-22 21:09:35 +0800
commit8c1bb7743784bb0f0754acc7f6855432fddca653 (patch)
treeacd032818992f12eca5284a0810b831d027e79bb /tests/integration/integration_test.go
parentac5b44b2f40a8d427805470f334b2c87bc4fdd32 (diff)
downloadgitea-8c1bb7743784bb0f0754acc7f6855432fddca653.tar.gz
gitea-8c1bb7743784bb0f0754acc7f6855432fddca653.zip
Remove test session cache to reduce possible concurrent problem (#22199)
Diffstat (limited to 'tests/integration/integration_test.go')
-rw-r--r--tests/integration/integration_test.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go
index 3537409aeb..911d9ddf4c 100644
--- a/tests/integration/integration_test.go
+++ b/tests/integration/integration_test.go
@@ -209,8 +209,6 @@ func (s *TestSession) MakeRequestNilResponseHashSumRecorder(t testing.TB, req *h
const userPassword = "password"
-var loginSessionCache = make(map[string]*TestSession, 10)
-
func emptyTestSession(t testing.TB) *TestSession {
t.Helper()
jar, err := cookiejar.New(nil)
@@ -225,12 +223,8 @@ func getUserToken(t testing.TB, userName string) string {
func loginUser(t testing.TB, userName string) *TestSession {
t.Helper()
- if session, ok := loginSessionCache[userName]; ok {
- return session
- }
- session := loginUserWithPassword(t, userName, userPassword)
- loginSessionCache[userName] = session
- return session
+
+ return loginUserWithPassword(t, userName, userPassword)
}
func loginUserWithPassword(t testing.TB, userName, password string) *TestSession {