aboutsummaryrefslogtreecommitdiffstats
path: root/modules/log/groutinelabel_test.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-12-21 00:20:51 +0800
committerGitHub <noreply@github.com>2024-12-20 16:20:51 +0000
commit1e71ad89cee8ea433ae32be0fd17cda3f1f5b0e8 (patch)
tree275015c0043348b83c32ca34311d30499667b76a /modules/log/groutinelabel_test.go
parentc20642fa9936c00e1277896152a0f73d89e3de4b (diff)
downloadgitea-1e71ad89cee8ea433ae32be0fd17cda3f1f5b0e8.tar.gz
gitea-1e71ad89cee8ea433ae32be0fd17cda3f1f5b0e8.zip
Deprecated gopid in log (#32932)
Diffstat (limited to 'modules/log/groutinelabel_test.go')
-rw-r--r--modules/log/groutinelabel_test.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/log/groutinelabel_test.go b/modules/log/groutinelabel_test.go
deleted file mode 100644
index 34e99653d6..0000000000
--- a/modules/log/groutinelabel_test.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2022 The Gitea Authors. All rights reserved.
-// SPDX-License-Identifier: MIT
-
-package log
-
-import (
- "context"
- "runtime/pprof"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func Test_getGoroutineLabels(t *testing.T) {
- pprof.Do(context.Background(), pprof.Labels(), func(ctx context.Context) {
- currentLabels := getGoroutineLabels()
- pprof.ForLabels(ctx, func(key, value string) bool {
- assert.EqualValues(t, value, currentLabels[key])
- return true
- })
-
- pprof.Do(ctx, pprof.Labels("Test_getGoroutineLabels", "Test_getGoroutineLabels_child1"), func(ctx context.Context) {
- currentLabels := getGoroutineLabels()
- pprof.ForLabels(ctx, func(key, value string) bool {
- assert.EqualValues(t, value, currentLabels[key])
- return true
- })
- if assert.NotNil(t, currentLabels) {
- assert.EqualValues(t, "Test_getGoroutineLabels_child1", currentLabels["Test_getGoroutineLabels"])
- }
- })
- })
-}