Skip to content

Commit

Permalink
remove obsolete test for testing leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Ludwig committed Sep 8, 2022
1 parent c153bcf commit 698ceaf
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"
"time"

logrustest "github.com/sirupsen/logrus/hooks/test"
"go.uber.org/goleak"

"github.com/avenga/couper/config/env"
)
Expand Down Expand Up @@ -106,42 +104,3 @@ func Test_realmain(t *testing.T) {
})
}
}

func Test_Main_Leaks(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
// defer cancel()

// defer goleak.VerifyNone(t)

t.Errorf("1 >>> %d", runtime.NumGoroutine())
go realmain(ctx, []string{"couper", "run", "-f", "server/testdata/settings/18_couper.hcl", "-watch"})
time.Sleep(time.Second / 2)
t.Errorf("2 >>> %d", runtime.NumGoroutine())

time.Sleep(time.Second / 3)

currentTime := time.Now()
os.Chtimes("server/testdata/settings/18_couper.hcl", currentTime, currentTime)
t.Errorf("3 >>> %d", runtime.NumGoroutine())

time.Sleep(time.Second / 3)

currentTime = time.Now()
os.Chtimes("server/testdata/settings/18_couper.hcl", currentTime, currentTime)
t.Errorf("4 >>> %d", runtime.NumGoroutine())

time.Sleep(time.Second / 3)

currentTime = time.Now()
os.Chtimes("server/testdata/settings/18_couper.hcl", currentTime, currentTime)
t.Errorf("5 >>> %d", runtime.NumGoroutine())

time.Sleep(time.Second / 3)

currentTime = time.Now()
os.Chtimes("server/testdata/settings/18_couper.hcl", currentTime, currentTime)
t.Errorf("6 >>> %d", runtime.NumGoroutine())

cancel()
goleak.VerifyNone(t)
}

0 comments on commit 698ceaf

Please sign in to comment.