Skip to content

Commit

Permalink
Missed defer prepareTestEnv (#9285)
Browse files Browse the repository at this point in the history
* onGiteaRun should defer the cleanup from prepareTestEnv

* Some more missed defers
  • Loading branch information
zeripath authored Dec 8, 2019
1 parent 37e10d4 commit 3da6d25
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integrations/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func BenchmarkRepo(b *testing.B) {
{url: "https://github.com/golang/go.git", name: "go", skipShort: true},
{url: "https://github.com/torvalds/linux.git", name: "linux", skipShort: true},
}
prepareTestEnv(b)
defer prepareTestEnv(b)()
session := loginUser(b, "user2")
b.ResetTimer()

Expand Down Expand Up @@ -75,7 +75,7 @@ func StringWithCharset(length int, charset string) string {

func BenchmarkRepoBranchCommit(b *testing.B) {
samples := []int64{1, 3, 15, 16}
prepareTestEnv(b)
defer prepareTestEnv(b)()
b.ResetTimer()

for _, repoID := range samples {
Expand Down
2 changes: 1 addition & 1 deletion integrations/git_helper_for_declarative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func allowLFSFilters() []string {

func onGiteaRun(t *testing.T, callback func(*testing.T, *url.URL), prepare ...bool) {
if len(prepare) == 0 || prepare[0] {
prepareTestEnv(t, 1)
defer prepareTestEnv(t, 1)()
}
s := http.Server{
Handler: mac,
Expand Down
2 changes: 1 addition & 1 deletion integrations/gpg_git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func TestGPGGit(t *testing.T) {
prepareTestEnv(t)
defer prepareTestEnv(t)()
username := "user2"

// OK Set a new GPG home
Expand Down

0 comments on commit 3da6d25

Please sign in to comment.