mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-01 02:29:40 +09:00
fix(process): reap entire process group on cmd.Cancel (#39143)
Signed-off-by: Royce Remer <royceremer@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
88974d2db9
commit
eea03676d3
@@ -39,7 +39,7 @@ func TestGPGGit(t *testing.T) {
|
||||
t.Setenv("GNUPGHOME", tmpDir)
|
||||
|
||||
// Need to create a root key
|
||||
rootKeyPair, err := importTestingKey()
|
||||
rootKeyPair, err := importTestingKey(t)
|
||||
require.NoError(t, err, "importTestingKey")
|
||||
|
||||
defer test.MockVariableValue(&setting.Repository.Signing.SigningKey, rootKeyPair.PrimaryKey.KeyIdShortString())()
|
||||
@@ -403,9 +403,9 @@ func crudActionCreateFile(_ *testing.T, ctx APITestContext, user *user_model.Use
|
||||
}, callback...)
|
||||
}
|
||||
|
||||
func importTestingKey() (*openpgp.Entity, error) {
|
||||
func importTestingKey(t *testing.T) (*openpgp.Entity, error) {
|
||||
keyPath := filepath.Join(setting.GetGiteaTestSourceRoot(), "tests/integration/private-testing.key")
|
||||
if _, _, err := process.GetManager().Exec("gpg --import "+keyPath, "gpg", "--import", keyPath); err != nil {
|
||||
if _, _, err := process.CommandContext(t.Context(), "gpg", "--import", keyPath).OutputString(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
keyringFile, err := os.Open(keyPath)
|
||||
|
||||
Reference in New Issue
Block a user